Expand my Community achievements bar.

SOLVED

Facing target data error while triggering email

Avatar

Level 4

Hi All,

 

Facing below error while trigerring real time emails, Could anyone please help in resolving this issue? Emails are not getting delivered.

 

Error while compiling script 'content htmlContent' line 8: targetData is not defined. SCR-160012 Javascript: error while evaluating script 'content htmlContent'.

 

Thank you

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Rut7 ,

Reason is, In your delivery there will be syntax like <%=  targetData.______ %> , This syntax in delivery will expect target data from input transition. if there is no such target data, then you will be getting this error.

  <%= targetData.field123 %> 

ParthaSarathy_0-1696598281199.png

 

Solution:

If you use a workflow,

Search for those targetData in your delivery, and in your workflow, add it as additional data using enrichment.

Example, if you have script  <%= targetData.field123 %> in delivery, create an enrichment before your delivery > add an output column as @field123

ParthaSarathy_1-1696598391248.png

 

ParthaSarathy_2-1696598412177.png

 

If you use SOAP API Request (transactional message), then modify target data <%= targetData._____ %> with syntax as below, (Depends on your Payload Request structure)

 

ParthaSarathy_0-1696601852208.png

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Rut7 ,

Reason is, In your delivery there will be syntax like <%=  targetData.______ %> , This syntax in delivery will expect target data from input transition. if there is no such target data, then you will be getting this error.

  <%= targetData.field123 %> 

ParthaSarathy_0-1696598281199.png

 

Solution:

If you use a workflow,

Search for those targetData in your delivery, and in your workflow, add it as additional data using enrichment.

Example, if you have script  <%= targetData.field123 %> in delivery, create an enrichment before your delivery > add an output column as @field123

ParthaSarathy_1-1696598391248.png

 

ParthaSarathy_2-1696598412177.png

 

If you use SOAP API Request (transactional message), then modify target data <%= targetData._____ %> with syntax as below, (Depends on your Payload Request structure)

 

ParthaSarathy_0-1696601852208.png

Avatar

Community Advisor

Hi @Rut7 ,

 

For Real time emails, the syntax which should be used in Transactional Templates would be <%=rtEvent.ctx.@email %>

 

As the Data is not coming from Schema, instead it should be picked from external Request , this syntax needs to be used.

 

Regards,

Pravallika.