Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Emails are not getting triggered when we use "add a script" to setoption in email content

balakrishnavalavala
Level 4
Level 4

Hi Team,

  

    Emails are not getting triggered when we use "add a script" to set option in email content.

 

Important things to note:

1) We are using hybrid model and mid sourcing sends out the emails.

2) When i use simple code like <% logInfo('something') %>, email is triggering

3) But when i use code like <% setOption('CustomOption',recipient.id) %>, emails are not triggering.

4) I am guessing that the marketing side option 'CustomOption' should also be available at mid side.

Could someone please help in finding why the emails are not triggering.

 

--> One more question that we have along with above i.e. We are looking to add some part of the dynamic email content as an attachment in same email. Below is the requirement.

Email Content:

Hi Customer,

     Some content here.

recipient.id

recipient.name

etc..

     Some content here.

Thanks

 

Here the highlighted part need to be written to a file and attach it to the same mail and also it should not print in the mail body. Could someone please help on this 2nd question as well.

 

Thanks you so much in advance.

 

0 Replies
balakrishnavalavala
Level 4
Level 4

Hi Manoj,

 

    Thank you so much for the quick reply. We are using the set option as below in email delivery's HTML Content.

balakrishnavalavala_0-1633377367184.png

For Point2: Looks like we need to install libreoffice application in marketig side which is not possible.at present and hence looking for other solutions.

 

Thanks

balakrishnavalavala
Level 4
Level 4

HI Manoj/Team,

 

    When we try to use the pdf functionality, we are getting below error from from preview.

 

balakrishnavalavala_0-1633400766108.png

 

Thanks

LaurentLam
Level 6
Level 6

Hello,
I never tried this approach: you should never use an option to store this type of data.
options are made for storing, once, "short" values at instance environment...
It means, even if you are able to make it works on the delivery properties side, when you have a 10K recipient delivery, you'll then update the option 10000 times...
it would be more efficient to set the option in your workflow or to create a specific typology rule (applied to the desired deliveries) in order to update the option once per delivery with a custom value

What are you trying to do on a functionnal point of view?


balakrishnavalavala
Level 4
Level 4

Hi Laurent,

 

    Thank you so much for the response. The main functionality here is, we are looking to send the personalized dynamic content of each recipient as an attachment in the email. Here we have tried .odt functionality (The content of of the file is personalized and converted to pdf during the delivery of each message) but it is throwing above attached error and also we are not looking the PDF format as attachment. To overcome this, I have a thought to set the option dynamically like above and get it in a custom JSSP page and then attach that content of the JSSP as an attachment in email delivery.

 

Please provide your suggestions on this ASAP.

 

Thanks

LaurentLam
Level 6
Level 6

I'm gonna be hard on this but if this for B2C purpose, I strongly do not recommand email attachment:
1- it's struggling your MTA during the sending: if you are sending huge volume at the same time, it will be a problem
2- you have more probability to create deliverability issues as ISP (hotmail, gmail, etc) are filtering harder emails with attachment than without

Good practice is to use a link in the email to download the attachment/file and to track the click on this CTA.

Jonathon_wodnicki
Community Advisor
Community Advisor

Hi,

 

For question 1: setOption() is unavailable in delivery content, per the error message you get when attempting it.

For question 2: Follow these steps:

  1. Use a file extract activity to write a csv file
  2. Use a js activity to execCommand() a shell script with vars.filename as an arg, e.g. execCommand('/opt/file_maker ' + vars.filename);
  3. Shell script produces files (pdf's?) for each row of csv with each file named after the recipient id, e.g. /tmp/row['recipient_id'].pdf
  4. Add a calculated attachment to your delivery, file name computed for each message, use recipient.id, e.g. <%= '/tmp/' + recipient.id + '.pdf %>

 

Thanks,

-Jon

PraveenMatsa
Level 2
Level 2

Hi Wodnick,

 

     Thank you so much for the response.

For point 1: I got clarity that setOption() is not available to use either in delivery content or personalization block based on your comment and also based on my analysis on this functionality. Which is bad and that leads to use the process mentioned in second point.

For point 2: I have the similar back up solution i.e. to generate a separate file for each segmented/targeted recipient. The downside that i observed here is since it is hybrid model, I am unable to get the files from marketing server paths and it is expecting that files needs to be available in public resources folder (mid side). When ever I provided the path from public resources then only mail with attachment is triggering but not when provided the Marketing file path. Please correct me if my observation/testing/analysis is wrong here.

 

Note: I will understood/try the approach provide in point 2 and will let all know the outcome.

 

Thank you so much for the support.

BalaKrishna Valavala

balakrishnavalavala
Level 4
Level 4

Hi Wodnick,

 

     Thank you so much for the response.

For point 1: I got clarity that setOption() is not available to use either in delivery content or personalization block based on your comment and also based on my analysis on this functionality. Which is bad and that leads to use the process mentioned in second point.

For point 2: I have the similar back up solution i.e. to generate a separate file for each segmented/targeted recipient. The downside that i observed here is since it is hybrid model, I am unable to get the files from marketing server paths and it is expecting that files needs to be available in public resources folder (mid side). When ever I provided the path from public resources then only mail with attachment is triggering but not when provided the Marketing file path. Please correct me if my observation/testing/analysis is wrong here.

 

Note: I will understood/try the approach provide in point 2 and will let all know the outcome.

 

Thank you so much for the support.

BalaKrishna Valavala

Sukrity_Wadhwa
Employee
Employee

Hi @balakrishnavalavala,

Were you able to resolve this query with the help of any of the given solutions or do you still need more help here? Do let us know.
Thanks!