How to add domain name to body of email
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 08:04 AM
With the above script im able to get domain URL and ID, but I need domain name, is it possible? when i use domain display name its giving message as un defined
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2024 04:58 AM
Hi @saikrishnag3019 ,
Please find below the code:
var uri = gs.getProperty("glide.servlet.uri");
var name = gs.getProperty("instance_name");
var iid = gs.getProperty("instance_id");
function extractRootDomain(uri) {
var domain;
if (uri.indexOf("://") > -1) {
domain = uri.split('/')[2];
} else {
domain = uri.split('/')[0];
}
domain = domain.split(':')[0];
var domainParts = domain.split('.');
if (domainParts.length > 2) {
domain = domainParts.slice(-2).join('.');
}
return domain;
}
var rootDomain = extractRootDomain(uri);
template.print(rootDomain);
If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.
Thanks,
Amitoj Wadhera