How to add params to all links in a mandrill template through API?

只愿长相守 提交于 2019-12-05 12:17:06

Sure, you can use merge tags to do this. Your link would look something like this:

<a href="http://google.com?param1=*|PARAM1|*&param2=*|PARAM2|*">click here</a>

You'd then want to pass the values for PARAM1 and PARAM2 in the SMTP headers, or in your API call.

For SMTP, you'd use the X-MC-MergeVars header. Here's more information on that specific header: http://help.mandrill.com/entries/21688056-Using-SMTP-Headers-to-customize-your-messages#mergetags

If you're using the API (messages/send or messages/send-template), you'd want to use the merge_vars or global_merge_vars parameters to set the values for PARAM1 and PARAM2 (merge_vars is for recipient-specific info, while global_merge_vars is for all recipients in that API call).

General overview on using merge tags to create dynamic content with Mandrill: http://help.mandrill.com/entries/21678522-How-do-I-use-merge-tags-to-add-dynamic-content-

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