generator-landmark
Version:
A LandmarkJS Project Generator for Yeoman
44 lines (37 loc) • 1.22 kB
JavaScript
<% if (includeGuideComments) { %>/**
* This file defines the email tests for your project.
*
* Each email test should provide the locals used to render the
* email template for preview.
*
* Values can either be an object (for simple tests), or a
* function that calls a callback(err, locals).
*
* Sample generated emails, based on the keys and methods below,
* can be previewed at /landmark/test-email/{key}
*/
<% } %>var landmark = require('landmark-serve');
module.exports = {
<% if (includeEnquiries) { %>
/** New Enquiry Notifications */
'enquiry-notification': function(req, res, callback) {
<% if (includeGuideComments) { %>
// To test enquiry notifications we create a dummy enquiry that
// is not saved to the database, but passed to the template.
<% } %>
var Enquiry = landmark.list('Enquiry');
var newEnquiry = new Enquiry.model({
name: { first: 'Test', last: 'User' },
email: 'contact@<%= _.slugify(projectName) %>.com',
phone: '+61 2 1234 5678',
enquiryType: 'message',
message: { md: 'Nice enquiry notification.' }
});
callback(null, {
admin: 'Admin User',
enquiry: newEnquiry,
enquiry_url: '/landmark/enquiries/'
});
}
<% } %>
};