Skip to main content
Solved

shorten dynamic product name

  • April 12, 2025
  • 1 reply
  • 29 views

Forum|alt.badge.img+1

How can i get a more shorter version of a dynmaic product name in the subject line

for example the product name is IBD hair growth , shampoo long 
i want it to be shorten to IBD hair growth

i have been trying to use this placeholder, but nor really working the way i want 
{{ event.Name |split:"|"|first|default:'item you needed' }}!

your feedback will be greatly appreciate 
 

Best answer by Byrne C

Hi ​@ayomi56987,

While shortening a dynamic variable to a certain number of words is unfortunately not possible at this moment, you can shorten it to a certain number of characters with the |truncate: filter. Since IBD hair growth has 15 characters, you can add |truncate:15 at the end of a variable, and it will make sure that variable is no longer than 15 characters. Note that this will add an ellipsis (. . .) at the end of the string, so you may or may not want to use this.

Using this filter would turn your variable into {{ event.Name|truncate:15|default:'item you needed' }}

Let me know if this helps, or if I can answer any additional questions!

-Byrne

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

Byrne C
Community Manager
Forum|alt.badge.img+18
  • Community Manager
  • 199 replies
  • Answer
  • April 14, 2025

Hi ​@ayomi56987,

While shortening a dynamic variable to a certain number of words is unfortunately not possible at this moment, you can shorten it to a certain number of characters with the |truncate: filter. Since IBD hair growth has 15 characters, you can add |truncate:15 at the end of a variable, and it will make sure that variable is no longer than 15 characters. Note that this will add an ellipsis (. . .) at the end of the string, so you may or may not want to use this.

Using this filter would turn your variable into {{ event.Name|truncate:15|default:'item you needed' }}

Let me know if this helps, or if I can answer any additional questions!

-Byrne