Want to limit the Email notification's subject (Which we receive in our mailbox) to 40 characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 02:30 AM
Hello All
I wanted to limit the subject from Email Notification to limit the subject characters to 40 and after 40th character it should show two dots ".."
Anyone knows how to achieve this ? where to write the script ? in Subject field or Message HTML field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 07:15 AM
Hi @spimple
Sure, you can achieve this by using JavaScript substring method in the Email Notification's subject field script. Here are the steps:
1. Navigate to the Email Notification record where you want to apply this limit.
2. In the "Subject" field, you can use JavaScript to limit the characters. For example, if you are using the Incident Short Description as the subject, you can use the following script:
(current.short_description.length > 40 ? current.short_description.substring(0, 40) + ".." : current.short_description)
This script checks if the short description is longer than 40 characters. If it is, it trims it to the first 40 characters and adds ".." at the end. If it's not longer than 40 characters, it just uses the whole short description.
3. Save the Email Notification record.
Please note that this will only limit the subject in the email notification, not the actual field in the record.
Please mark it Correct and Hit Like if you find this helpful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 01:14 AM
Yes i can use substring but What I am doing is I have created a Email Notification.. And when i recieve email subect should be limit to 40 characters.. how to connect all that ? bcz in subject field I could not do that substring thing.. where can i do that