1

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

我们有一个在线表格,可以提出不同的问题,其中一个是性别,我想在发送的电子邮件中填充一张图片。本质上,我正在寻找可以做到这一点的东西:

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

如果有人有一个示例 Apache Velocity 脚本(我从未使用过,所以继续大笑)我会非常感激你。我可以很好地复制,我只是无法从教程中弄清楚如何制作foo = bar....谢谢!

4

2 回答 2

1

您需要使用条件来创建一个包含图像路径的变量,然后将其打印到您的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>

这里也有一些例子:

文档/电子邮件脚本

于 2015-07-22T23:30:12.737 回答
0

一个更高级的例子:

#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} >
于 2019-11-27T16:42:40.647 回答