Mailchimp Conditional Merge tags using a date field not working

拜拜、爱过 提交于 2019-12-22 13:55:56

问题


This is not about the API. This is about using Mailchimp and setting conditional merge fields in the backend of Mailchimp when building a campaign. So this question is about how Mailchimp works rather than about integrating Mailchimp via an API or something similar.

(You're still here? Great! :-)

I'm trying to use a date field to show conditional content. I have 3 people in my test mailing list, one with birthday 1/1/1960, one with 1/1/1970 and one with 1/1/1980.

I've set up an email with three conditional block so that each recipient should get the right piece of text in his mail. It looks like this.

The format I'm using is:

*|IF:BIRTHDATE>1/1/1970|*
Some text for people with a birthdate greater than 1 jan 1970
*|END:IF|*

*|IF:BIRTHDATE=1/1/1970|*
Some text for people with a birthdate equal to 1 jan 1970
*|END:IF|*

*|IF:BIRTHDATE<1/1/1970|*
Some text for people with a birthdate smaller than 1 jan 1970
*|END:IF|*

I've taken the date of the 1st of jan (1/1) to avoid possible conflicts with US and EU date notations to rule that out of the debugging process. However, eacht recipient receives the last of the three texts when sending the test mailing, meaning that all three, regardless of their birthdate somehow match the last condition *|IF:BIRTHDATE<1/1/1970|* This is strange since I've deliberately taken the middel birthdate to rule this out.

The date notation in the list of recipients matches the exact dat notation that I'm using in the conditions.

Does anyone have any idea how this should be done with dates in Mailchimp? I can't find any iformation on that on either Mailchimp or anywhere else on the net.


回答1:


You have to use the format 'YYYY-MM-DD'.

I was struggling with this, too, but I have the below working:

*|IF:VALIDUNTIL=2016-12-31|*
Vaild Member
*|ELSE:|*
Expired Member
*|END:IF|*



回答2:


Don't know if this is a recent change, but Roger's answer only works for exact date comparison.

*|IF:JOINED=2017-01-31|*
   You joined ON jan 31st
*|ELSE:|*
   You joined literally any other date
*|END:IF|*

If you want to use comparisons, they work the same as any other merge tag (But only in the YYYY-MM-DD format)

*|IF:JOINED>2017-01-31|*
   You joined after January 31st 2017
*|ELSE:|*
   You joined before January 31st 2017
*|END:IF|*


来源:https://stackoverflow.com/questions/35501986/mailchimp-conditional-merge-tags-using-a-date-field-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!