To show email content based on options selected in list field

Poorva Bhawsar
Mega Sage

Hi Community,

 

I have created a custom field on change form which is of type LIST. Whatever multiple options change team has selected in this field, it should trigger an email for those options only along with some dynamic content.

 

For eg.: If user selects justification, backout plan, implementation plan etc in the list field, it should show email content for justification, backout plan, implementation plan only along with some dynamic content for these selections. Please see content for justification below:

  • Justification
    Justification details are insufficient, Enter benefits of implementing this change and impact if this change is not implemented.

How can i modify email script for the multiple options selected in list field and it should show the email content related to the options selected.

3 REPLIES 3

karthiknagaramu
Kilo Sage

Hi,

Please try if the below option works.

In email script read the value of the list field (I believe it will be a comma separated sys_ids).

And then push the value in to a array. 

Loop through the array and for each value (if it same as field name), do a switch and include the required content using template.print.

 

Regards,

Karthik Nagaramu

Can you please share me a sample code for this?

Poorva Bhawsar
Mega Sage

Hi @karthiknagaramu ,

 

Can you please help me with the sample code?

 

Thanks,

Poorva Bhawsar