【问题标题】:change mandrill template dynamically using php使用php动态更改山魈模板
【发布时间】:2013-10-14 03:26:04
【问题描述】:

我正在使用 mandrill 应用程序从我的网站发送电子邮件。 我知道如何使用 Mandrill 发送模板。

我想动态更改模板。我不知道该怎么做。 在Site 上,他们提到使用 |---| 动态更改模板。这里他们也提到了如何在 JSON 代码中声明全局合并变量。

我的问题是如何在 PHP 代码中定义全局合并变量?

【问题讨论】:

    标签: php mandrill


    【解决方案1】:

    可能我误解了你的问题,但这是我的回答: 我假设您使用的是mandrill php library 那么

    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);
    

    【讨论】:

    • 嘿,谢谢我回答了可能的问题。我想问如何使用 mandrill PHP 替换模板中的文本。
    猜你喜欢
    • 2014-10-14
    • 2013-05-18
    • 1970-01-01
    • 2015-08-27
    • 2014-07-14
    • 2015-11-17
    • 2014-06-24
    • 2016-11-16
    • 1970-01-01
    相关资源
    最近更新 更多