BCC field for email client template used in Major incident

Community Alums
Not applicable

We have a email client template which we are using for technical communication in major incidents(Sev 1/sev 2).

I want to use BCC field dynamically according to Incident severity i.e, sev1/sev2.

I tried mail script in htmlBody as well as in bcc but seems not working. I am also not able to use dot walking variables like we used in subject over there.

Can anyone help me with this?

find_real_file.png

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hey Manas,

My email engine is also enabled.

Actually I found one article by service now that this email object doesn't work or exist for email client template at the time of sending. This email.addAddress() only works for notification or email template.

I was just playing around it and got a solution.

Following is the business rule I've return & it worked for me. Because when we click send button in communication tab of major incident and email client template appears, it creates an entry in email logs though we send that email or not.

find_real_file.png

View solution in original post

7 REPLIES 7

Community Alums
Not applicable

Hey Manas,

My email engine is also enabled.

Actually I found one article by service now that this email object doesn't work or exist for email client template at the time of sending. This email.addAddress() only works for notification or email template.

I was just playing around it and got a solution.

Following is the business rule I've return & it worked for me. Because when we click send button in communication tab of major incident and email client template appears, it creates an entry in email logs though we send that email or not.

find_real_file.png

Hi,

 

I initially tried this approach but had some challenges due to the fact that we need to specify some conditions on the subject for this to work. Also, if we wanted to use different recipients for each communication plan, we'd need new conditions. So this is what I've done and it worked for me:

  • Using email client template, the To field is always mandatory and I found in one community post that the function getEmailMetadata is always populating that field on the communication task. In our scenario, we wanted the To field to always be a specific mailbox so I didn't want all the recipients from the communication plan to be copied into the To field again. So I had to override the function getEmailMetadata using script include CommunicationManagementUtil (the original function is on CommunicationManagementUtilSNC) and comment the line coping the information into the To field: find_real_file.png
  • Create a new function to retrieve the recipients list to include on the BCC field: find_real_file.png
  • Update email client template using the new function: find_real_file.png

Naveen77
Tera Contributor

Try to write script include and call that script include in the bcc field using javascript:script include name.

 

or else create a field on incident table and populate what data you want in the newly created field and call that field name in the bcc field