ServiceNowDevProgram / code-snippets

ServiceNow's Code Snippets community repository, managed by the Developer Program and the sndevs community.
https://github.com/ServiceNowDevProgram/Hacktoberfest
284 stars 647 forks source link

Trigger email from Script #1545

Open ersureshbe opened 1 day ago

ersureshbe commented 1 day ago

Use the following script to send email dynamically

var mail = new GlideEmailOutbound(); mail.setSubject('Hello darkness, my old friend'); mail.addRecipient('sn@sn.com'); mail.addAddress('cc', 'abc@abc.com'); mail.setBody("I've come to talk with you again"); mail.save();

wiz0floyd commented 1 day ago

Did you mean to create this as an issue?

ersureshbe commented 1 day ago

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.

wiz0floyd commented 1 day ago

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

ersureshbe commented 1 day ago

Yes.

wiz0floyd commented 1 day ago

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

ersureshbe commented 21 hours ago

Yes, Can you please add it?

wiz0floyd commented 21 hours ago

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