如何回送以提供心轴模板占位符的值

问题描述 投票:-1回答:1

从回送如何为心轴模板的占位符提供值

loopback mandrill
1个回答
0
投票
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
                            }]
                        }
                    },
© www.soinside.com 2019 - 2024. All rights reserved.