2015-04-22 07:50:11 +09:00
|
|
|
Meteor.startup(function () {
|
|
|
|
|
|
|
|
// New user email
|
|
|
|
|
|
|
|
Router.route('/email/new-user/:id?', {
|
|
|
|
name: 'newUser',
|
|
|
|
where: 'server',
|
|
|
|
action: function() {
|
|
|
|
var user = Meteor.users.findOne(this.params.id);
|
|
|
|
var emailProperties = {
|
|
|
|
profileUrl: Users.getProfileUrl(user),
|
|
|
|
username: Users.getUserName(user)
|
|
|
|
};
|
2015-05-13 11:52:00 +09:00
|
|
|
html = Telescope.email.getTemplate('emailNewUser')(emailProperties);
|
|
|
|
this.response.write(Telescope.email.buildTemplate(html));
|
2015-04-22 07:50:11 +09:00
|
|
|
this.response.end();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// New post email
|
|
|
|
|
|
|
|
Router.route('/email/new-post/:id?', {
|
|
|
|
name: 'newPost',
|
|
|
|
where: 'server',
|
|
|
|
action: function() {
|
|
|
|
var post = Posts.findOne(this.params.id);
|
|
|
|
if (!!post) {
|
2015-05-13 11:52:00 +09:00
|
|
|
html = Telescope.email.getTemplate('emailNewPost')(Posts.getProperties(post));
|
2015-04-22 07:50:11 +09:00
|
|
|
} else {
|
|
|
|
html = "<h3>No post found.</h3>"
|
|
|
|
}
|
2015-05-13 11:52:00 +09:00
|
|
|
this.response.write(Telescope.email.buildTemplate(html));
|
2015-04-22 07:50:11 +09:00
|
|
|
this.response.end();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|