Email notification from a transform map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2015 12:41 PM
We have an inbound email action that takes an excel attachment and runs a transform map. I have an onBefore script that is checking to make sure a few fields are in the proper format. For example, make sure the date is in a certain format and that the IP address is in a valid range. All of this is currently working. Our customer is wanting an email that contains the errors so they can fix them. So if the date is incorrect they would get an email saying something like "row 10 - invalid date format" or "row 5 - ip address is invalid".
My question is how can I send out an email and save the information that was incorrect from a transform map script? Most likely there could be multiple rows with errors from a single transform of the email attachment.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2015 12:29 AM
Hi Steve,
If you create a variable in onStart script in the transform map as discussed above, you can trigger the email in the onComplete transform script itself.
If a variable is created in the onStart transform script, it is accessible by all the other scripts. So, you can update the value of the variable in the onBefore scripts, to append error details. And, once all rows have been transformed, you can send an email from the onComplete transform script using this variable as one of the parameters of the gs.eventQueue() function.
Thanks,
Mandar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2015 06:36 AM
Mandar,
My onComplete script is now adding my event to the event queue. If I look at the event table I can see my events being created and all the parameters are correct (userEmail and importErrors).
Script:
gs.eventQueue('email.installrequesterrors', curent, userEmail, importErrors);
My problem is that my email notification is not being triggered by the event. If I look in the outbox or email log I never see any emails being generated.
Here are my email settings:
Any help would be appreciated! I've been stuck for a couple days on this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2015 12:23 PM
Hi Steve,
There are some things that you can cross-check.
1. userName contains correct email adresses.
2. Also, if its just you in the email address, do check the send to event creator check box.
3. If there are multiple users, check that email notification is set to true for all of them.
Also, in the screenshots provided, the event you triggered(email.installrequesterrors) is different than the event specified in the email notification.(email.readunoinstallrequesterrors)
Make sure both are exactly same.
You can put some log statements to identify the parameters passed to the gs.eventQueue() function.
Hope that helps.
-Mandar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2015 12:39 PM
Hey Mandar,
In the log the parameters are coming in as expected.
So far I've tried:
- Checking event param 1 contains recipient.
- User/Groups in fields - using param 1 from the slushbucket
- Send to event creator
- User - then selecting my name from the list so the email will only come to me.
None of them are working. Our emails are turned off in dev but nothing is listed in the Email Log or in the outbox/sent/failed/error under the system mailboxes -> outbound. Other notifications I am working on have been working correctly but they are not event driven, they wait until one of the record's status fields changes to a specific value.
Everything is working as expected but the email is not being triggered by an Event.
Thank you so much for the help so far!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2015 11:39 PM
Hi Steve,
From the looks of it, most part of your requirement is achieved, there must be some minor thing preventing the mail from getting triggered.
Since, you are using yourself as the recipient, keep "Send to event creator" checked. System finds that you are triggering the event, and event creator should not receive the mail as per notification. Hence, it skips the mail processing.
Also, as I mentioned earlier the event name in the email notification must exactly match that in the event, it was different as per your earlier screenshots.
Lastly, simply put a simple Hello in the email and no complex body content to ascertain that no mail_script error is causing the error.
-Mandar