2

Does anyone know if it is possible to Trigger an email, using AMPScript or SSJS, from within an email ?

My use case is this : I have an email, which contains a complex amount of AMPScript and has a RaiseError function in the event of a condition not being met. The client would like for a notification email to be sent on the event of a RaiseError.

I have attempted to script with SSJS a CreateObject("TriggeredSend") However upon testing, Marketing Cloud errors :

CreateObject Function is not valid in content. This function is only allowed in non sendable content. Function: CreateObject("TriggeredSend")

My gut feeling is that triggering an email from within an email isn't possible. Can anyone advise of its feasibility ?

1 Answer 1

6

While it is possible, in a manner of speaking, I would instead recommend upserting the error info into a DE and have an hourly scheduled automation to send the alert to your client.

This would have an (at most) hour delay on some errors, but is also much more efficient and has less likelihood of causing timeouts on email sends.

If an immediate solution is necessary, then I would have a POST go to a Cloud Page that contains the Trigger API call on it. This is not a recommended solution, especially if there is any significant volume on the sends. This could cause timeout errors due to the increase in code processing.

1
  • Thanks Gortonington - I'm going to give that a try and reckon the CloudPage solution will work for me. We do need the email to be triggered immediately; but thankfully the occurrence will be low/seldom and should only ever affect/apply to a single record. We've build a safe-guard solution for the client where the Marketer has to accept sending terms and an anticipated sending volume. If the terms haven't been accepted or the volumes don't match the data extension then it will fail the send - and now should alert the marketer by email
    – Gravitai
    Sep 13, 2018 at 13:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .