How to display links in the email body as a clickable hyperlinks instead a plain text in description
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 01:26 PM
Problem: At present, when a request is initiated through inbound action, the email body is captured within the description field in text format. However, it's noteworthy that URL links within the email body are currently stored merely as text. As part of enhancing user experience and functionality, there is a need for these URLs to be rendered as clickable hyperlinks for ease of navigation and efficient access to pertinent resources.
Ask: URL links found within the email body stored within the description field, rendered as clickable hyperlinks to ensure seamless access and navigation for users.
Solution:
1. Create a new HTML type field label as Detailed Description or as per business needed
2. inbound action needs to be modified using the below script
function convertURLsToLinks(text) {
// Regular expression to find URLs within the text
var urlRegex = /(https?:\/\/[^\s]+)/g;
// Replace URLs with clickable links
return text.replace(urlRegex, function(url) {
return '<a href="' + url + '">' + url + '</a>';
});
}
var emailBody = email.body_text;
var convertedEmailBody = convertURLsToLinks(emailBody);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 02:10 PM
This is one way you could do it. Another way is to take the HTML body and post it into the work notes field with "[code][/code]" tags around it rather than create another description field. And yes I used [] on purpose.