douci1677 2016-02-09 13:00
浏览 63

Mandrill不会替换html模板中的合并标记内容

     Mandrill API Logs  -- 

"subject": "Valentine’s Day special offer. Additional 10% off* on select categories! View exclusive online offer",
        "from_email": "habits@zip.in",
        "from_name": "zipp",
        "to": [
            {
                "email": "xyza_123@gmail.com",
                "name": "venk",
                "type": "to"
            }
        ],
        "merge": true,
        "merge_vars": [
            {
                "rcpt": "xyza_123@gmail.com",
                "vars": [
                    {
                        "name": "UNSUB",
                        "content": "http://zyr.com/unsubscribe/GYT786HHG"
                    },
                    {
                        "name": "FirstName",
                        "content": "venk"
                    }
                ]
            }
        ],

    "async": false,
    "ip_pool": null,
    "send_at": null,

And when I click on the unsubscriber link in the template, it takes me to the url http://*|unsub|*. Mandrill is not replacing |UNSUB| with http://zyr.com/unsubscribe/GYT&786HHG. Please help me . I spent a lot of time on it, but am unable to solve it

                <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width:100%;" class="mcnTextContentContainer">
                    <tbody><tr>

                        <td valign="top" class="mcnTextContent" style="padding-top:9px; padding-right: 18px; padding-bottom: 9px; padding-left: 18px;">

                            You can&nbsp;<a href="*|UNSUB|*" target="_blank">unsubscribe</a><br>
<br>
&nbsp;
                       </td>
                    </tr>
                </tbody></table>
            </td>
        </tr>
    </tbody>
</table>
  • 写回答

1条回答 默认 最新

  • donglaogu3788 2016-02-09 22:04
    关注

    There's no need to pass in UNSUB as a merge variable. Mandrill takes care of all of that for you. UNSUB is a reserved merge tag too, which is why it's not being replaced with the value you pass in your API call.

    So in your API call, remove the merge var altogether:

     {
                        "name": "UNSUB",
                        "content": "http://zyr.com/unsubscribe/GYT786HHG"
                    },
    

    And in your HTML template, use this instead:

    You can&nbsp;<a href="*|UNSUB:http://zyr.com/unsubscribe/GYT786HHG|*" target="_blank">unsubscribe</a><br>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 yolov8边框坐标
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂