how to send 2 different email to different people.

TMKAM
Tera Contributor

I have an issue to create a workflow and notification as per below scenario.

 

scenario 1

1. user submit catalog request.

2. 1st email approver is to HOD number 1 with different email content.

3. Approved by the 1st email approver which is the HOD number 1.

4. 2nd email approver is to HOD number 2 with different email content.

5. Approved by the 2nd email approver which is the HOD number 2.

6. email notification send to the requester.

 

I have created 2 email notification.

1st email approver is HOD number 1.

2nd email approver is to HOD number 2.

 

I attach the workflow and notification for your reference.

20 REPLIES 20

Hi Ankur,

 

is like this as attached.

@TMKAM 

you are already having condition then don't give any script in advanced notification script section

I forgot that part.

Simply create email script and add in your new notification and print the content based on 1st approval or 2nd approval

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

How do I do that? please advise.

 

Thank you

@TMKAM 

in email script check if the current approval is the 1st one, if yes it means you can add your content 1

In email script check if how many approval records are there excluding the current one, if you get count as 1 it means the email has triggered for 2nd approval so give content 2

something like this but please enhance

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

    // Add your code here
    var gr = new GlideRecord("sysapproval_approver");
    gr.addQuery("sysapproval", current.sysapproval);
    gr.query();
    var count = gr.getRowCount();
    if (count == 1) {
        // this is for 1st approval
        // content 1
    } else {
        // this is for 2nd approval
        // content 2
    }

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

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@TMKAM 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader