Trying to send email notifications to Demand Stakeholders when project state changes

Mike Stockman1
Giga Guru

I'm trying to send email notifications to the stakeholders when a project state changes but am not getting any notifications to go to the Stakeholder. If i add myself to the User, I get a notification.

I'm using the 'dmn_m2m_demand_stakeholder' table and have tried the following configurations.

I've tried setting When to send in these 2 manners but have no change in result:

When to send:

  • Send when: even is fired
  • Event name: pm_project.updated
  • Conditions: Updated is anything

And I've tried:

When to send:

  • Record inserted or updated
  • Conditions: Demand.Project.State changes

Who will receive:

Users/Groups in fields: Stakeholder

What it will contain:

  • PROJECT CREATED STAKEHOLDER -- ${stakeholder.user.name}
  • Stakeholder User: ${stakeholder.user}
  • Stakeholder User Email: ${stakeholder.user.email}
  • Stakeholder: ${stakeholder}

Thanks for any guidance!

1 ACCEPTED SOLUTION

You have to use Mail Scripts for that


http://wiki.servicenow.com/?title=Scripting_for_Email_Notifications#gsc.tab=0



find_real_file.png



If you see in the script I have current project record, I can write a logic to get all stakeholders email using simple joins.



Now in the Notifications I do the following



find_real_file.png




In the message text - notice that I am doing ${mail_script: send_mail_to_stake_holder} which would be my mail script


In the Who will receive tab, give some default address for the TO.


Stakeholders will be added in the CC of the email, as you can see email.addAddress in line 9 of the script


View solution in original post

6 REPLIES 6

arun_vydianatha
ServiceNow Employee
ServiceNow Employee

It is not clear how you setup the Email



When I setup on pm_project table, Update, State changes, it was working fine for me.



find_real_file.png




find_real_file.png



I am not sure how you are navigating from Project to Stakeholder - do you have any custom fields?


what do you have in your 'who will receive' tab?     I could only find stakeholder by going to dmn_m2m_demand_stakeholder.


thx!


You have to use Mail Scripts for that


http://wiki.servicenow.com/?title=Scripting_for_Email_Notifications#gsc.tab=0



find_real_file.png



If you see in the script I have current project record, I can write a logic to get all stakeholders email using simple joins.



Now in the Notifications I do the following



find_real_file.png




In the message text - notice that I am doing ${mail_script: send_mail_to_stake_holder} which would be my mail script


In the Who will receive tab, give some default address for the TO.


Stakeholders will be added in the CC of the email, as you can see email.addAddress in line 9 of the script


thx that worked!