From an email script can you abort an email?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 09:27 AM
I have some complex logic in an email script for one of my email notifications. If there a way, from the email script, to abort the email from sending?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 09:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2017 12:09 AM
My very dirty solution to this was, in my notification script, when I hit a point where I knew I needed to abort the message, I wrote out a very unique string to the message body. Then, I had a business rule on sys_email that looked for and dropped messages with that string before they were sent.
Dirty and a horrible practice, yes.
Effective, yes, as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 08:54 AM
Depending on what your logic is you might be able to change the notification to be event triggered and then do your testing in a business rule. Depending on what kind of data you need you might be able to offload everything but the template.print to the business rule. That would make it easier to abort but might not allow you to do what you are trying.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 10:05 AM
Hi Eric,
Either you have to use Advanced Script as dvp suggested or you have to got to use business rule in sys_email to stop it as Mathew suggested.
To add to what Mathew suggested you could use the email (Emailoutbound object) to set the subject to an unique string and use a business rule on sys_email to abort further action.
email.setSubject("")