Make text in 'RED' color in mail scripts for inbound email actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 11:27 AM
Hello Experts,
For inbound actions, I am using mail script where I have the below line of code. And It shows as below screenshot when 'Reject' button is clicked on the notification.
Mailscript:
screenshot:
But, We want "[Insert Rejection Comments Here]" to be in RED color. what should be the modification in my line of code?
Thanks.
Rocky.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 11:38 AM
Hi, have you tried using style="color:red" in your href link? or css?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 11:55 AM
Hi Tony,
I need 'RED' color only to the highlighted part in my screenshot i.e. this part [Insert Rejection Comments Here].
Can you please provide me the full line of code with modification that you want me to try on my machine?
Thanks,
Rocky.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:33 PM
Hey @Rocky5,
You can add a Span tag and &Content-Type=text/html to the URL.
<a href="mailto:' + emailAddress + '@service-now.com?subject=RE: Rejected: ' + current.number + '&Content-Type=text/html&body=Click send on this email to save your selection in ServiceNow and Reject this Idea.%0d%0aProvide any comments below to be included in the Rejection Comments on the record:%0d%0a%0d%0a<span style='color:red'>[ Insert Rejection Comments Here ]</span>%0d%0a%0d%0a%0d%0a' + email.watermark + '">Reject</a>;
However, it didn't work for me on the Outlook. It may work on previous versions and may not work on other email clients.
According to the Mailto specification, you can add whatever arbitrary headers you want to your mailto link. This means you could add &Content-Type=text/html to the URL to indicate it's an HTML message, in which case it should parse your HTML and CSS like a normal HTML email.
However, the spec also states that the only headers that should be relied upon are the subject and body headers.
The creator of a mailto URL cannot expect the resolver of a URL to understand more than the "subject" and "body" headers. Clients that resolve mailto URLs into mail messages should be able to correctly create RFC 822-compliant mail messages using the "subject" and "body" headers.
In other words, you can try it but don't expect it to work for everyone. If this is for public use, just forget about it, and stick to plaintext.
More on it here.
Regards,
Hamza