Alex - we created a support ticket back on Aug. 1. Marketo was able to reproduce this behavior (where it only rendered properly with trigger campaigns but not batch campaigns. But since this is a P3 ticket, Support does not have the capacity to look further into this at this time. Yes, frustrating.
Hi all,
this is probable a bit outdated, however, we run into the same problem and what did the trick for us was just removing the curly brackets from the script:
${display.br($lead.fieldName)} --> $display.br($lead.fieldName)
I am not a programmer, so I can't explain why it worked, but maybe it will help somebody.
Mmm, neither of these can have any effect when line breaks do not exist at all in the source string.
They're also completely identical once parsed by the Velocity engine.
hey @SanfordWhiteman @DanB did you manage to find a solution for the line break not displaying in email alerts?
I inherited these scripts:
${lead.legalvisionEmailClickHistory.replaceAll("%newline%","<br/>")}
${lead.legalvisionInterestingMomentsHistory.replaceAll("%newline%","<br/>")}
${lead.legalvisionWebPageHistory.replaceAll("%newline%","<br/>")}
but they were not working so I created {{my.line-break}} using method described in https://blog.teknkl.com/dark-mkto-alleys-line-break-token/# and replaced %newline% in flow step for {{my.line-break}}
however still no luck - this fixed the way the fields display in Marketo lead record
but not in email alerts
I also tried changing the scripts to the ones you mentioned but no luck:
${display.br($lead.legalvisionWebPageHistory)}
${display.br($lead.legalvisionEmailClickHistory)}
${display.br($lead.legalvisionWebPageHistory)}
These are my flow steps:
if custom field is empty
{{system.dateTime}}: {{trigger.Trigger Name}} {{trigger.Name}} {{trigger.Web Page}}
else
{{system.dateTime}}: {{trigger.Trigger Name}} {{trigger.Name}} {{trigger.Web Page}} {{my.line-break}}{{lead.legalvisionWebPageHistory}}
I'm using an html email template coded for Marketo and referencing the token as follows
I've tried contacting Marketo support but they said they cant help with velocity script syntax.
Any help would be much appreciated! 🙂
This is a longstanding Marketo bug.
A Textarea field’s line breaks (that is, \n = standard U+000A) are simply stripped out before the field is output. This unfortunately includes when you try to manipulate the value in Velocity: the line breaks are gone before Velocity could even get a change to turn them into HTML breaks (<br>).
The workaround — and it’s quite cumbersome — is to add another type of break in addition to the \n.
I like to use U+001E before the U+000A.
So in the Line Break Token setup, instead of
%5Cn
do
%5Cu001E%5Cn
Then in VTL you can split on that:
${display.list($lead.field.split("\u001e"),"<br>")}
Amazing! Thanks heaps @SanfordWhiteman 🙂 I'll give this solution a go 🤞
I am having same challenge.
In the Marketo Flow Action logic the Attribute LOV only displays Lead attributes ( lead fields).
If you create a program token you will not find in the Lead attribute list.
Program Tokens are only available in Digital Assets (EMail or LP) for now.