Meteor.startup(function () {
Router.route('/email/campaign', {
name: 'campaign',
where: 'server',
action: function() {
var campaign = buildCampaign(getCampaignPosts(Settings.get('postsPerNewsletter', 5)));
var campaignSubject = '
Subject: '+campaign.subject+' (note: contents might change)
';
var campaignSchedule = 'Scheduled for: '+ Meteor.call('getNextJob') +'
';
this.response.write(campaignSubject+campaignSchedule+campaign.html);
this.response.end();
}
});
Router.route('/email/digest-confirmation', {
name: 'digestConfirmation',
where: 'server',
action: function() {
var confirmationHtml = getEmailTemplate('emailDigestConfirmation')({
time: 'January 1st, 1901',
newsletterLink: 'http://example.com',
subject: 'Lorem ipsum dolor sit amet'
});
this.response.write(buildEmailTemplate(confirmationHtml));
this.response.end();
}
});
});