【问题标题】:How loopback to provide values for mandril template placeholder如何环回为 mandril 模板占位符提供值
【发布时间】:2020-03-06 18:11:46
【问题描述】:

来自 loopback 如何为 mandril 模板的占位符提供值

【问题讨论】:

    标签: loopback mandrill


    【解决方案1】:
    In this case we have use something like this in mandril template
    <p>You may log in to application with this temporary password: <span mc:edit="newPassword"></span> </p> 
    
    In loopback code i.e  in remote hook in my case i have defined in routes.js as
    User.on('resetPasswordRequest', function (info) {
    //my info object has the password set
    User.app.models.Email.send({
                            to: info.email,
                            from: 'abc',
                            subject: 'application Password Reset',
                            template: {
                                name: "mandril template as defined in mandril",
                                content: [{
                                    name: "newPassword", //name is placeholder name
                                    content: info.options.password //  i have already set my password in info object being passed to this remote hook
                                }]
                            }
                        },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-10
      相关资源
      最近更新 更多