0
此Meteor代碼接受來自用戶的電子郵件並在服務器上調用方法createNewUser
。使用onEnrollmentLink實施sendEnrollmentEmail
Meteor.methods({
'createNewUser': function (email) {
const userId = Accounts.createUser({email: email, password: 'dummy'});
Accounts.sendEnrollmentEmail(userId);
}
});
我收到一封電子郵件,該鏈接
http://localhost:3000/#/enroll-account/6I-arlzO2Kpz4N4KOtb_8UOO1dR_YrKbparLjsF9PNd
如何使用Accounts.onEnrollmentLink()
表明我做出接受密碼的模板,因爲現在它只是把我到http://localhost:3000/#,順便說一句我沒有使用路由包。
<template name="passwordCreate">
<h5>Please create a password for your account</h5>
<input type="text" name="pswrd1" placeholder="Enter a password">
<input type="text" name="pswrd2" placeholder="Re enter the password">
</template>
我的問題主要是關於如何在Accounts.onEnrollmentLink()方法中編碼,即放置/使用它的方式以及語法的外觀。 ;) –