Sending Mails through ServiceNow Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have been trying to send the mails to fetched email through scripts but in server script it is not propagating the input action Client Script
c.sendEsignRequest = function() {
if (!c.sys_id) {
c.message = "⚠️ Please enter a sys_id.";
return;
}
if (!c.email) {
c.message = "⚠️ No email found for this user.";
return;
}
c.message = "⏳ Sending request...";
console.log("DEBUG: Sending email to", c.email);
// ✅ Wrap payload in {data: ...} for .update()
c.server.update({
data: {
action: 'sendRequest',
sys_id: c.sys_id,
email: c.email
}
}).then(function(resp) {
var result = resp.data || resp;
if (result.success) {
c.message = "✅ E-sign request sent successfully!";
c.sys_id = '';
c.email = '';
} else {
c.message = "❌ " + (result.error || "Failed to send email");
}
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @AbdulMajidK8082
To better assist you, could you please clarify the specific business requirement or use case you're aiming to address with this implementation? Understanding the context will help us suggest the most suitable approach and design considerations.
Looking forward to your response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
i was fetching the email of the user based on the sys_id of the record in a table
and was trying to send the mail to that particular user for e-sign