首页 文章

Mandrill的UNSUB合并标签未被解析

提问于
浏览
0

我试图这样做,当有人点击通过Mandrill API(使用PHP)发送的电子邮件中的取消订阅链接时,它的工作原理如下:http://help.mandrill.com/entries/23815367-Can-I-add-an-automatic-unsubscribe-link-to-Mandrill-emails-

*|UNSUB|* merge标记未被解析 . 它只是通过收到的电子邮件的正文 .

接近消息内容的末尾($ message_content)我有:

<a href="*|UNSUB:http:/mydomain.com/unsubscribe-from-mailing-lists/|*">Click here to unsubscribe.</a>

在Gmail中,链接为:点击此处取消订阅 . (不是有效的HREF,因此Gmail只会忽略锚标记)

在Outlook 2010中,链接为:单击此处取消订阅 . (不是有效的HREF)

我应该在 Headers 中添加一些merge_vars参数吗? http://help.mandrill.com/entries/21678522-How-do-I-use-merge-tags-to-add-dynamic-content-提及它们,但我找不到UNSUB合并标记的参数 .

$mandrill = new Mandrill($mandrill_api_key);
        $message = array(
            'html' => $message_content,
            'subject' => $subject,
            'from_email' => 'me@mydomain.com',
            'from_name' => 'MY NAME',
            'to' => $to_list,       
            'headers' => array('Reply-To' => 'me@mydomain.com'),
            'important' => false,
            'track_opens' => 1,
            'track_clicks' => null,
            'auto_text' => null,
            'auto_html' => null,
            'inline_css' => null,
            'url_strip_qs' => null,
            'preserve_recipients' => 0,
            'view_content_link' => 1,
            'tracking_domain' => null,
            'signing_domain' => null,
            'return_path_domain' => null,
            'merge' => true,
            'global_merge_vars' => array(
                array(
                    'unsub' => 'unsub'
                )
            ),

        );

我错过了什么步骤? TIA!

1 回答

  • 1

    问题是URL缺少斜杠(http:/ mydomain ...)这是由TinyMCE转换URL引起的 . 我将 convert_urls: false 添加到tinymce.init,这解决了我的问题 .

    感谢Mandrill支持我帮助我找出问题所在 .

相关问题