code-snippets icon indicating copy to clipboard operation
code-snippets copied to clipboard

Trigger email from Script

Open ersureshbe opened this issue 2 years ago • 7 comments

Use the following script to send email dynamically

var mail = new GlideEmailOutbound(); mail.setSubject('Hello darkness, my old friend'); mail.addRecipient('[email protected]'); mail.addAddress('cc', '[email protected]'); mail.setBody("I've come to talk with you again"); mail.save();

ersureshbe avatar Oct 28 '24 19:10 ersureshbe

Did you mean to create this as an issue?

wiz0floyd avatar Oct 28 '24 20:10 wiz0floyd

It wont create an issue. Instead of using 'Notification' OOB module you can write 4 line code and initiate the notification based on your business requirement.

ersureshbe avatar Oct 28 '24 21:10 ersureshbe

You created an Issue on GitHub. Did you mean to submit a pull request?

wiz0floyd avatar Oct 28 '24 21:10 wiz0floyd

Yes.

ersureshbe avatar Oct 28 '24 21:10 ersureshbe

Do you want to make a pr with this code snippet so that you can get Hacktoberfest credit?

wiz0floyd avatar Oct 29 '24 00:10 wiz0floyd

Yes, Can you please add it?

ersureshbe avatar Oct 29 '24 12:10 ersureshbe

You will need to create your own pull request to get credit. Please see the link here and look at the contributing and readme files for any repo you wish to make additions to.

https://www.servicenow.com/community/developer-advocate-blog/servicenow-hacktoberfest-2024/ba-p/3052690

wiz0floyd avatar Oct 29 '24 12:10 wiz0floyd