2016-04-15 21 views
0

カスタムURLを作成してHTMLメールに渡そうとしています。電子メールは今のところ動作しますが、ライブURLアドレスを含むようにアプリケーションをライブでプッシュすると、手動でURLを変更する必要があります。これを行う方法はありますか?メールにURLリンクを追加する

私が何をしようとしている

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

答えて

1

本番環境でROOT_URL変数を設定する必要があります。これを行うと、Meteor.absoluteUrl("/profile")メソッドは正しいURLを返します。

関連する問題