管理者に新しいユーザー通知メールを送信しようとしています。電子メールは新しいユーザーの名前、姓または電話番号が電子メールに送られてきますが、理由はわかりません。助言がありますか?ユーザーが新しいアカウントを登録したときに電子メールに電子メールが表示されない
更新
メールに渡していないデータがある:
var emailData = { firstName: (user && user.profile && user.profile.firstName), familyName: (user && user.profile && user.profile.familyName), phone: (user && user.profile && user.profile.phone) };
パス:startup.js
Accounts.onCreateUser(function (options, user) {
if (options.profile && options.profile.roles) {
//include the user profile
Roles.setRolesOnUserObj(user, options.profile.roles);
}
if (options.profile) {
// include the user profile
user.profile = options.profile;
}
// other user object changes...
// ...
user.accountStatus = { isUserAccountActive: false };
// In your client code: asynchronously send an email
Meteor.call('newUser');
return user;
});
パス:email.js
newUser: function() {
// 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('newUserRegistration.html'));
var user = Meteor.user();
var emailData = {
firstName: (user && user.profile && user.profile.firstName),
familyName: (user && user.profile && user.profile.familyName),
phone: (user && user.profile && user.profile.phone)
};
Email.send({
to: "[email protected]",
from: "[email protected]",
subject: "New user registration",
html: SSR.render('htmlEmail', emailData)
});
},
私は質問を理解できないので、あなたの質問を言い換えてください。私はあなたが直面している問題を理解できません。ありがとう。私は間違いなくあなたを助けるだろう。ありがとうankur。 –
それは少し助けますか? – bp123
あなたが得ているものを見るためにemaildataを準備する前に、console.log()を使用してください。流星だけでなく、流星のコンソールで得られる出力のスクリーンショットも添付してください。 –