SOLVED

suggestions for token use in subject alert

Go to solution
Tracy_Boesken
Level 4

suggestions for token use in subject alert

Hello community,

An internal request from our support department asked if the Marketo email alert's subject line  (they receive - triggered when someone requests support on our contact us form) can contain a unique identifier (of sorts) because the subject carries with the support ticket for the life of the ticket. Currently, I have the requester's full name token in the subject and tried using the comments token but it makes it ridiculously long. Marketo support verified there is not a way to limit the character amount returned in a token.

Suggestions for what could take its place?

Thanks,

--Tracy

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor

Re: suggestions for token use in subject alert

You can use velocity script to display first x characters in the email. The below script displayes the first 20 characters in the "Comments" field.

 

#set( $first20chars = $display.truncate($lead.Comments,20,"") )
${first20chars}

 

 

Reference - https://nation.marketo.com/t5/product-discussions/trim-string-to-x-characters-in-velocity/m-p/297841...

 

View solution in original post

7 REPLIES 7
Darshil_Shah1
Level 10 - Community Advisor

Re: suggestions for token use in subject alert

You can use velocity script to display first x characters in the email. The below script displayes the first 20 characters in the "Comments" field.

 

#set( $first20chars = $display.truncate($lead.Comments,20,"") )
${first20chars}

 

 

Reference - https://nation.marketo.com/t5/product-discussions/trim-string-to-x-characters-in-velocity/m-p/297841...

 

SanfordWhiteman
Level 10 - Community Moderator

Re: suggestions for token use in subject alert

So frustrating that Support would say it can't be done when, as Darshil shows, it obviously can!
Tracy_Boesken
Level 4

Re: suggestions for token use in subject alert

Thank you! @Darshil_Shah1 

I placed the script:

Tracy_Boesken_0-1659653952184.png

but it came in as:

Tracy_Boesken_1-1659654227616.png

Is this because the subject line exceeds the character limit?

Darshil_Shah1
Level 10 - Community Advisor

Re: suggestions for token use in subject alert

@Tracy_Boesken, you 'd need to add the velocity script to an email script my token and the add that script token to the email like you'd add any other normal token. Here is the product documentation page on how to create an email script token for your reference, make sure you select the Comments field from the object tree in the right, only check-marked fields are available to velocity.

 

Email Script token - 

Darshil_Shah1_0-1659670147265.png

Add this custom script token in the subject line in the email - 

Darshil_Shah1_2-1659670326273.png

 

Let us know if you have any questions.

 

Tracy_Boesken
Level 4

Re: suggestions for token use in subject alert

@Darshil_Shah1  Thanks for your patience. Not sure what I am still doing wrong: 

Tracy_Boesken_0-1659712095972.png

 

 

Tracy_Boesken_1-1659712095973.png

 

 

Tracy_Boesken_2-1659712095974.png

 

Darshil_Shah1
Level 10 - Community Advisor

Re: suggestions for token use in subject alert

The token name has the "-" (dash) characters b/w words, whereas, the one you've in the email's subject line has space characters (" "). The token name should exactly match for Marketo to be able to refer to it. You should insert the token using the "Insert Token" option which appears next to the subject line in the email (it'll appear when you start editing the subject line).

 

Reference snapshot below - 

Darshil_Shah1_0-1659713924990.png

Start typing the token name in the insert token dialog, and select it once you see your token in the drop-down. Lastly, click insert to add the token.

Darshil_Shah1_1-1659714106411.png

Let us know how it goes. 🙂

 

Tracy_Boesken
Level 4

Re: suggestions for token use in subject alert

@Darshil_Shah1 ...I am an idiot. Thanks!

I changed it and it is closer but still not quite right:

Screenshot 2022-08-05 120425.png