How to stop an email from being sent when a macro errors?

Lance Keay asked on December 17, 2015 16:23

Hi, We are using the marketing automation and sending out emails. Sometimes one of the macro expressions inside the email template fail, and the email is sent, but a portion of the body is blank.

Is there a way to detect a failed macro and abort sending the email?

Thanks

Recent Answers


Brenden Kehren answered on December 17, 2015 16:36

I believe you might spend a bit of time trying to get that implemented. A better solution might be to have a default value for a macro if there isn't a value or something fails. Or better yet, create your own macro method which will return a default.

1 votesVote for this answer Mark as a Correct answer

Lance Keay answered on December 17, 2015 16:47

Thanks for the quick reply. Neither of those options are useful - it means still sending the email, but with nonspecific/useless info in place of the intended info.

I'm looking for something that: 1 - stops the email being sent if there is a macro error. 2 - send a notification to admin about the error, so that they can correct and resend.

I think it may be something that's not possible, since the macro parsing happens outside the automation step's knowledge. Maybe I should make a custom automation action that parses and looks for blanks and test it's output before attempting to send the email.

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 17, 2015 17:25

So you're saying there's bad data? Is that the issue or why would it error out? On top of what you mentioned (creating the custom automation process), you might also create a task to check that data every N hours/minutes and clean it up as needed. I think you can also perform checks inside your automation task without creating a custom one to see if the value is null, blank, some value, etc. Haven't set one up like that before but could be possible.

1 votesVote for this answer Mark as a Correct answer

Lance Keay answered on December 17, 2015 19:56

No, it's intermittent - it runs fine 10 times and then, out of the blue, it errors. Extending the macro dwell time to 2000ms seems to have fixed it. But it'd be nice to have macro error information in the Workflow!

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 18, 2015 14:05

That would be a good addition Lance. Pop over to http://ideas.kentico.com and submit that as a new idea.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.