我正在尝试创建自定义网址并将其传递到HTML电子邮件中。但是,当我推送应用程序以包含实时网址时,我必须手动更改网址。有没有办法做到这一点?
我正在尝试做什么:
Dev enviroment
localhost:3000/profile
Live enviroment
www.address.com/profile
-
sendEmail: function (subject, userId) {
check([subject, userId], [String]);
// Let other method calls from the same client start running,
// without waiting for the email sending to complete.
this.unblock();
SSR.compileTemplate( 'htmlEmail', Assets.getText( 'sendEmail.html' ) );
// to find the users info for the logged in users
// var user = Meteor.user();
var emailData = {
url: Meteor.absoluteUrl() + "/profile"
};
Email.send({
to: to,
from: from,
subject: subject,
html: SSR.render( 'htmlEmail', emailData )
});
}
答案 0 :(得分:1)
您需要在生产环境中配置ROOT_URL
变量。执行此操作时,方法Meteor.absoluteUrl("/profile")
将返回正确的URL。