简体   繁体   English

将PHP变量添加到Mandrill模板

[英]Add PHP variables to Mandrill template

I just made the switch from the PHP mail function to Mandrill, but Mandrill sees the PHP in the email as HTML and prints the variables like this: 我刚刚从PHP邮件功能切换到Mandrill,但Mandrill将电子邮件中的PHP视为HTML,并打印如下变量:

在此处输入图片说明

Does anyone know how to add PHP to the HTML template? 有人知道如何将PHP添加到HTML模板吗?

Doesn't look like you can use PHP with Mandrill, but you can use placeholders for custom content. 看起来您可以将PHP与Mandrill结合使用,但是可以将占位符用于自定义内容。 Please take a look at the section of this page titled "Create dynamic content (placeholders for custom content)" 请查看该页面标题为“创建动态内容(自定义内容的占位符)”的部分。

Definity you can use PHP variable with template,same issue i was facing, Definity您可以将PHP变量与模板一起使用,我遇到的同样问题,

by using below statement,you can pass PHP code 通过使用以下语句,您可以传递PHP代码

<div mc:edit="main_content"></div>

Your code will be look like that 您的代码将如下所示

<div mc:edit="main_content">
  $title=$occasion

</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM