1

I've a Notification (sysevent_email_action) that will be using a Email Script (sys_script_email). The notification is defined on "Global" table and under "Send when", it's set as "Event is fired". The event contains parm1 data which will be processed inside the email script.

I was wondering if from inside the email script, I can define a variable and then use that variable inside the notification template?

So, the flow is:

(a) Event abc is fired with event.parm1 containing some data

(b) Notification gets executed when abc is triggered

(c) Notification calls an email script

(d) Inside the email script, abc's parm1 is accessed and a variable is defined. Let's say something like this:

    (function runMailScript(current, template,
 email, email_action, event) {
    
             var eventData = JSON.parse(event.parm1);
             // do something with eventData
             // then define a variable
             var data_to_use_in_template = eventData.foo;
             var data_to_use_in_template2 = eventData.bar;
    
    })(current, template, email, email_action, event);

(e) In Notification template, somehow use data_to_use_in_template and data_to_use_in_template2 that got populated with data in email script.

Hi,

Thank you for responding back. Here are details of the order:

Foo: ${data_to_use_in_template}

Bar: ${data_to_use_in_template2}
asprin
  • 9,579
  • 12
  • 66
  • 119

0 Answers0