电子邮件和模板的速度脚本



我是在Marketo中编写脚本的新手,我正在寻找在Marketo中使用if/then语句的示例脚本。

我们有一个在线表格,会问不同的问题,其中一个是性别,我想在发送的电子邮件中填充一张图片。从本质上讲,我要找的是这样的东西:

if gender = male then display xyz.male.gif
if gender = female then display xyz.female.gif

如果有人有一个Apache Velocity脚本的例子(我从来没有使用过,所以继续笑),我将大大欠你的债。我可以很好地复制,我只是不能从教程中弄清楚如何制作foo = bar ....谢谢!

您将需要使用条件来创建包含图像路径的变量,然后将其打印到img标记(或任何需要的地方)。像这样:

#if ( $lead.Gender = Male )
    #set ( $image = "www.example.com/male.jpg" )
#else 
    #set ( $image = "www.example.com/female.jpg")
#end
<img src="${image}"></img>

这里也有一些例子:

文档/电子邮件脚本

一个更高级的例子:

#if ( ${lead.MarketoSocialGender} == "Male" )
    #set ( $image = "https://example.com/male.jpg" )
#elseif ( ${lead.MarketoSocialGender} == "Female" )
    #set ( $image = "https://example.com/female.jpg" )
#else
    #set ( $image = "https://example.com/other.jpg" )
#end
<img src="${image} >

最新更新