我正在使用 mandrill 应用程序从我的网站发送电子邮件。我知道如何使用 Mandrill 发送模板。
我想动态更改模板。我不知道该怎么做。在这个网站上,他们提到使用|---| 动态更改模板。在这里,他们还提到了如何在 JSON 代码中声明全局合并变量。
我的问题是如何在 PHP 代码中定义全局合并变量?
可能我误解了你的问题,但这是我的答案:我假设你正在使用mandrill php 库 然后
require 'Mandrill.php';
$mandrill = new Mandrill($password);
$message = array(
'html' => $html //here you can provide your html for template
//receiver and so on
);
$mandrill->messages->send($message);