Trigger an email notification from service portal page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 10:55 PM
Hi All,
I have a requirement where I need to send an email from the service portal page. There are two buttons on a form and on click of one of the buttons, it should trigger an email notification with the details filled in the form. How can this be achieved using angularjs?
Thanks in advance,
Jessie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 11:42 PM
Hi
You can generate a record directly in the outbox.
You will need to do this via a server side function: Communicating between the Client Script and the Server Script of a widget - ServicePortal.io - Servi...
Then get this server side function to generate a new mail in the outbox
var mail = new GlideRecord("sys_email");
mail.initialize();
mail.mailbox.setDisplayValue("Outbox");
mail.recipients = ("mail@mail.com");
mail.subject = ("Subject of mail");
mail.body = ("Body of mail");
mail.type = "send-ready";
mail.content_type = "multipart/mixed";
mail.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2017 12:08 AM
Hi Lars,
Thank you for the response. Wanted to know if we can use gs.eventqueue? Also that there are two submit buttons , i think from the client controller we need to do something to differentiate it.
Regards,
Jessie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2017 01:38 AM
Hi Lars,
I tried the above and got an error as this is a scoped application. Below is the error -
Create operation against 'sys_email' from scope 'abc' has been refused due to the table's cross scope policy.
Any way to access the sys_email table?
Regards,
Jessie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2017 12:25 AM
You could use the event queue but that will require that you have a relevant record to bind the event to - if you do that will be the best solution