Sending Mails through ServiceNow Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours 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
5 hours 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.