In my application, I want to sow the database with users and send them a link to activate my account (and select a password). I also want them to check / modify some profile data.
On the server, I seed the database as follows:
Meteor.startup(function () {
if(Meteor.users.find().count() === 0) {
var user_id = Accounts.createUser({ email: 'some@email.com', profile: { some: 'profile' } });
Accounts.sendEnrollmentEmail(user_id);
}
})
The registration link is sent as expected, but I want to create a custom template when I click the URL in the email. Preferably handled by an iron router. (Do not use ui account pack).
I tried things like redirecting a user to a user route as follows:
var doneCallback, token;
Accounts.onEnrollmentLink(function (token, done) {
doneCallback = done;
token = token;
Router.go('MemberEnroll')
});
which doesn't work (it changes the url but doesn't display my pattern)
I also tried changing the server registration URL as follows:
Accounts.urls.enrollAccount = function (token) {
return Meteor.absoluteUrl('members/enroll/' + token);
};
, Accounts.onEnrollmentLink .
, URL- , , .
.