0

I am working on sending transactional emails to our recipients according to visitors activity in the last week, such that I'll want to deliver at the end the following email including 12 profiles maximum:

Hi, User, bla bla look these profiles:   

Visitor's Name, Age, link to Visitor's image    
Maria         , 39 , http://images.fixapp.com/t-16985.jpg    
*
* 12 profiles 
*
Elena        , 33, http://images.fixapp.com/t-16915.jpg

Click here to see all your visitors profiles

So far I advanced very well with the task doing the following:

  1. Added custom properties for all 12 profiles
  2. I've uploaded contact list details with all data via a CSV file
  3. I've written a raw html template and bounded the template's placeholders to the custom properties of list details For example:

<div class="new__faces__img"><img src='[[data:visitor1.photo]]'></div>
<div class="new__faces__name">
  <span>[[data:visitor1.name]]</span>, [[data:visitor1.age]]
</div>

> other visitors ...

<div class="new__faces__img"><img src='[[data:visitor12.photo]]'></div>
<div class="new__faces__name">
  <span>[[data:visitor12.name]]</span>, [[data:visitor12.age]]
</div>

What I still don't know is how to handle the case when a user has less than 12 visitors. Mandrill email service in such cases offers conditional merge tags. What is the way of MailJet to resolve the issue?

4

1 回答 1

1

我在 Mailjet 领导开发者关系。首先,感谢您对我们 API 的关注!

目前,我们的系统不支持对象属性,因此您将无法在 HTML 代码中使用它们,例如visitor1.photo. 要表示此类数据,您可以为每个访问者的信息创建元数据,例如 visitor1_photo 或 visitor1_age。

从那里,您将能够像在示例中那样在 HTML 代码中使用它。

我们正在开发高级模板功能。同时,最好的方法是在您这边预处理消息以生成最终模板并通过我们的发送 APISMTP发送。

通过使用X-Mailjet-Campaign SMTP 标头(发送 API 中的 mj-campaign)将消息分组到同一营销活动下,您可以获得与营销营销活动相同的行为。

希望能帮助到你!

于 2015-06-01T12:52:05.583 回答