CSS for links in email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2015 09:01 AM
Hi All,
How to set the color for ${URI_REF} in email notifications. By default it is coming in blue color. I kept text color as red by using Rich HTML editor but it is coming as blue only in emails.
Any idea on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2015 04:15 PM
Hi Sannavulla,
Your HTML snippet seems to be all good. I checked with "Preview Notification" and its rendering red color text as expected.
Can you check your email notification on the browser (web version) and do inspect-element to see if has the css property. Just guessing if there is anything wrong with email client (ex: Outlook).
Thanks,
Manjul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2015 09:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2015 09:43 PM
Hi Sannavulla,
Could you please confirm that you have below HTML in your HTML Editor ?
<div>Short description: ${short_description}</div>
<div>Click here to view: <span style="color: #ff0000;">${URI_REF}</span></div>
<div>
<div><hr /></div>
</div>
<div>Comments:</div>
<div>${comments}</div>
The reason i'm not sure is because you don't seem to have a <a> tag in it, whereas the screenshot of the preview window you shared seem to have <a> tag. Also the Incident number seem to be clickable.
If it was a missing piece, then I think blue color underlined text is coming because of <a> tag text-decoration.
Here is how your html should be:
<div>Short description: ${short_description}</div>
<div>Click here to view: <i><a style="color: #ff0000; text-decoration: none;" href="#">${URI_REF}</a></i></div>
<div>
<div><hr /></div>
</div>
<div>Comments:</div>
<div>${comments}</div>
Hope this help!
Manjul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2015 11:22 PM
Hi Sannavulla,
Please ignore my previous reply, I didnt knew that URI_REF is a pre compiled link which is being append in the <span>.
As Gurpreet suggested, you may have to tweak URI_REF.
When it comes to style the text, just make sure to add "<a style="color: #ff0000; text-decoration: none;">....</a>"
-Manjul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2015 10:13 PM
Its very hard to use css in emails. Only inline style tag works well.
URI_REF is a pre compiled link with no css applied of link text color. By this we i mean to say that URI REF will get replaced with a link like below
URI_REF = <a href="example.com">TEXT</a>
Now , if you i don't know if it will work if you again use URI_REF in href attribute of 'a' tag.
Here you may need to create your own custom link with inline style tag to change link text
<mail_script>
var baseUrl = gs.getProperty('glide.servlet.uri');
template.print('<a style="color:red;" href="'baseUrl+current.getTableName()+'.do?sys_id='+current.sys_id+'">'+current.number+'</a>');
</mail_script>