Onclick of UI Action, an email client should be opened with some body of data autopopulated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2024 04:53 AM - edited ‎10-10-2024 04:54 AM
Onclick of UI Action, an email client should be opened with some body of data autopopulated.I am using this function-emailClientOpenPop to populate some different to,subject and body.It is not working.please help me with any other functions we can achieve this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2024 01:16 PM
Hello @kethineni ,
Please try this logic:
// Define the email parameters
var to = "recipient@example.com"; // Add the recipient email
var subject = "Your Subject Here"; // Define the subject
var body = "This is the body of the email.\n\n"; // Define the email body
// Encode the subject and body to be URL-friendly
subject = encodeURIComponent(subject);
body = encodeURIComponent(body);
// Construct the mailto link
var mailtoLink = "mailto:" + to + "?subject=" + subject + "&body=" + body;
// Open the email client
window.location.href = mailtoLink;
Thank you.
Please hit on the helpful button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2024 10:13 PM
Hello @mihirlimje867
I don't want to use outlook email. I need to use email client within the ServiceNow. Please provide your inputs based on this.Thank you!