Pull reference variable value into email notification

nicolemccray
Tera Expert

I'm trying to pull in the display value of my reference variable 'vend_name', but will not work.   The 'Requested For First Name' is pulling in as expected:

Hello ${request.requested_for.first_name},

Your request for a New Mexico Non-Taxable Transaction Certificate (NTTC) for ${current.variables.vend_name.getDisplayValue()} has been completed. Please find attached the certificate for your use.

1 ACCEPTED SOLUTION

Nicole, you don't need to use a mail script and that is causing the extra line.   Use the following instead:


Hello ${request.requested_for.first_name},


Your request for a New Mexico Non-Taxable Transaction Certificate (NTTC) for ${request_item.variables.vend_name} has been completed. Please find attached the certificate for your use.


Thank you,


View solution in original post

22 REPLIES 22

Table Name - [sc_task]



find_real_file.png




find_real_file.png


Nicole, thanks for these details.   Given your notification is on sc_task, is that variable available on the task when you view it?   If not, you may need to do this:


${current.request_item.variables.vend_name}


Got it working using:



(function runMailScript(current, template, email, email_action, event) {




                  // Add your code here


template.print(current.request_item.variables.vend_name.getDisplayValue());



})(current, template, email, email_action, event);




Any idea how I can keep it from appearing on a new line?:



find_real_file.png


Hi Nicole,



PLease post the verbiage to see how you have it set up.   You can also convert it to HTML to get more control on the "look" of the notification.


Hello ${request.requested_for.first_name},


Your request for a New Mexico Non-Taxable Transaction Certificate (NTTC) for${mail_script:nmnttc.vend_name}has been completed. Please find attached the certificate for your use.


Thank you,