mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
reorganising email templates and debug routes; created two new nova:email-templates and nova:debug packages
This commit is contained in:
parent
544c51fbfe
commit
7886ea80de
39 changed files with 259 additions and 188 deletions
|
@ -31,7 +31,7 @@ nova:api
|
|||
nova:rss
|
||||
nova:kadira
|
||||
nova:email
|
||||
nova-demo
|
||||
nova:email-templates
|
||||
|
||||
# nova:migrations
|
||||
# nova:invites
|
||||
|
@ -40,5 +40,8 @@ nova-demo
|
|||
|
||||
############ Custom Packages ############
|
||||
|
||||
nova:demo
|
||||
nova:debug
|
||||
|
||||
accounts-twitter
|
||||
# accounts-facebook
|
||||
|
|
|
@ -85,14 +85,16 @@ momentjs:moment@2.12.0
|
|||
mongo@1.1.6
|
||||
mongo-id@1.0.3
|
||||
mongo-livedata@1.0.11
|
||||
nova-demo@0.25.7
|
||||
nova:api@0.25.7
|
||||
nova:base-components@0.25.7
|
||||
nova:base-styles@0.25.7
|
||||
nova:categories@0.25.7
|
||||
nova:comments@0.25.7
|
||||
nova:core@0.25.7
|
||||
nova:debug@0.25.7
|
||||
nova:demo@0.25.7
|
||||
nova:email@0.25.7
|
||||
nova:email-templates@0.25.7
|
||||
nova:embedly@0.25.7
|
||||
nova:events@0.25.7
|
||||
nova:forms@0.25.7
|
||||
|
|
|
@ -113,6 +113,7 @@ Nova tries to maintain a consistent file structure for its main packages:
|
|||
- `routes.jsx`: routes.
|
||||
- `views.js`: views used for [query constructors](https://www.discovermeteor.com/blog/query-constructors/).
|
||||
- `parameters.js`: the collection's query constructor.
|
||||
- `email_routes.js`: test routes for email templates.
|
||||
- `server/publications.js`: publications.
|
||||
|
||||
## Customizing Components
|
||||
|
|
|
@ -65,11 +65,4 @@ Telescope.registerComponent("UserAvatar", require('./users/UserAvatar.jsx'));
|
|||
Telescope.registerComponent("UserName", require('./users/UserName.jsx'));
|
||||
Telescope.registerComponent("UserMenu", require('./users/UserMenu.jsx'));
|
||||
Telescope.registerComponent("AccountsMenu", require('./users/AccountsMenu.jsx'));
|
||||
Telescope.registerComponent("AccountsForm", require('./users/AccountsForm.jsx'));
|
||||
|
||||
// debug
|
||||
|
||||
Telescope.registerComponent("Cheatsheet", require('./debug/Cheatsheet.jsx'));
|
||||
Telescope.registerComponent("Settings", require('./debug/Settings.jsx'));
|
||||
Telescope.registerComponent("Emails", require('./debug/Emails.jsx'));
|
||||
|
||||
Telescope.registerComponent("AccountsForm", require('./users/AccountsForm.jsx'));
|
|
@ -1,7 +1,6 @@
|
|||
import React from 'react';
|
||||
import Router from './router.js'
|
||||
import {mount} from 'react-mounter';
|
||||
import Campaign from 'meteor/nova:newsletter';
|
||||
|
||||
import SmartContainers from "meteor/utilities:react-list-container";
|
||||
const DocumentContainer = SmartContainers.DocumentContainer;
|
||||
|
@ -107,150 +106,9 @@ Router.route('/users/:slug/edit', {
|
|||
|
||||
// ------------------------------------- Other -------------------------------- //
|
||||
|
||||
Router.route('/cheatsheet', {
|
||||
name: 'cheatsheet',
|
||||
action() {
|
||||
({App, Cheatsheet} = Telescope.components);
|
||||
mount(App, {content: <Cheatsheet/>});
|
||||
}
|
||||
});
|
||||
|
||||
Router.route('/settings', {
|
||||
name: 'settings',
|
||||
action() {
|
||||
({App, Settings} = Telescope.components);
|
||||
mount(App, {content: <Settings/>});
|
||||
}
|
||||
});
|
||||
|
||||
Router.route('/emails', {
|
||||
name: 'emails',
|
||||
action() {
|
||||
({App, Emails} = Telescope.components);
|
||||
mount(App, {content: <Emails/>});
|
||||
}
|
||||
});
|
||||
|
||||
FlowRouter.notFound = {
|
||||
action() {
|
||||
({Error404} = Telescope.components);
|
||||
mount(App, {content: <Error404/>});
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------- Emails (Server) -------------------------------- //
|
||||
|
||||
Telescope.email.routes = [
|
||||
{
|
||||
name: "New Post",
|
||||
path: "/email/new-post/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var post = typeof params.id === "undefined" ? Posts.findOne() : Posts.findOne(params.id);
|
||||
if (!!post) {
|
||||
html = Telescope.email.getTemplate('newPost')(Posts.getNotificationProperties(post));
|
||||
} else {
|
||||
html = "<h3>No post found.</h3>"
|
||||
}
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Post Approved",
|
||||
path: "/email/post-approved/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var post = typeof params.id === "undefined" ? Posts.findOne() : Posts.findOne(params.id);
|
||||
if (!!post) {
|
||||
html = Telescope.email.getTemplate('postApproved')(Posts.getNotificationProperties(post));
|
||||
} else {
|
||||
html = "<h3>No post found.</h3>"
|
||||
}
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "New Comment",
|
||||
path: "/email/new-comment/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var comment = typeof params.id === "undefined" ? Comments.findOne() : Comments.findOne(params.id);
|
||||
var post = Posts.findOne(comment.postId);
|
||||
if (!!comment) {
|
||||
html = Telescope.email.getTemplate('newComment')(Comments.getNotificationProperties(comment, post));
|
||||
} else {
|
||||
html = "<h3>No post found.</h3>"
|
||||
}
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "New Reply",
|
||||
path: "/email/new-reply/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var comment = typeof params.id === "undefined" ? Comments.findOne() : Comments.findOne(params.id);
|
||||
var post = Posts.findOne(comment.postId);
|
||||
if (!!comment) {
|
||||
html = Telescope.email.getTemplate('newReply')(Comments.getNotificationProperties(comment, post));
|
||||
} else {
|
||||
html = "<h3>No post found.</h3>"
|
||||
}
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "New User",
|
||||
path: "/email/new-user/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var user = typeof params.id === "undefined" ? Meteor.users.findOne() : Meteor.users.findOne(params.id);
|
||||
var emailProperties = {
|
||||
profileUrl: Users.getProfileUrl(user),
|
||||
username: Users.getUserName(user)
|
||||
};
|
||||
html = Telescope.email.getTemplate('newUser')(emailProperties);
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Account Approved",
|
||||
path: "/email/account-approved/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var user = typeof params.id === "undefined" ? Meteor.users.findOne() : Meteor.users.findOne(params.id);
|
||||
var emailProperties = {
|
||||
profileUrl: Users.getProfileUrl(user),
|
||||
username: Users.getUserName(user),
|
||||
siteTitle: Telescope.settings.get('title'),
|
||||
siteUrl: Telescope.utils.getSiteUrl()
|
||||
};
|
||||
var html = Telescope.email.getTemplate('accountApproved')(emailProperties);
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Newsletter",
|
||||
path: "/email/newsletter",
|
||||
action: (params, req, res, next) => {
|
||||
var campaign = Campaign.build(Campaign.getPosts(Telescope.settings.get('postsPerNewsletter', 5)));
|
||||
var newsletterEnabled = '<div class="newsletter-enabled"><strong>Newsletter Enabled:</strong> '+Telescope.settings.get('enableNewsletter', true)+'</div>';
|
||||
var mailChimpAPIKey = '<div class="mailChimpAPIKey"><strong>mailChimpAPIKey:</strong> '+(typeof Telescope.settings.get('mailChimpAPIKey') !== "undefined")+'</div>';
|
||||
var mailChimpListId = '<div class="mailChimpListId"><strong>mailChimpListId:</strong> '+(typeof Telescope.settings.get('mailChimpListId') !== "undefined")+'</div>';
|
||||
var campaignSubject = '<div class="campaign-subject"><strong>Subject:</strong> '+campaign.subject+' (note: contents might change)</div>';
|
||||
var campaignSchedule = '<div class="campaign-schedule"><strong>Scheduled for:</strong> '+ Meteor.call('getNextJob') +'</div>';
|
||||
res.end(newsletterEnabled+mailChimpAPIKey+mailChimpListId+campaignSubject+campaignSchedule+campaign.html);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Newsletter Confirmation",
|
||||
path: "/email/newsletter-confirmation",
|
||||
action: (params, req, res, next) => {
|
||||
var confirmationHtml = Telescope.email.getTemplate('newsletterConfirmation')({
|
||||
time: 'January 1st, 1901',
|
||||
newsletterLink: 'http://example.com',
|
||||
subject: 'Lorem ipsum dolor sit amet'
|
||||
});
|
||||
res.end(Telescope.email.buildTemplate(confirmationHtml));
|
||||
}
|
||||
}
|
||||
];
|
||||
};
|
|
@ -22,11 +22,7 @@ Package.onUse(function (api) {
|
|||
// third-party packages
|
||||
|
||||
'tmeasday:check-npm-versions@0.3.0',
|
||||
// 'alt:react-accounts-ui@1.2.1',
|
||||
// 'alt:react-accounts-unstyled@1.2.1',
|
||||
// 'std:accounts-ui-basic@1.0.1',
|
||||
'std:accounts-ui@1.1.12',
|
||||
'dburles:spacebars-tohtml@1.0.1',
|
||||
'utilities:react-list-container',
|
||||
'kadira:dochead@1.4.0'
|
||||
]);
|
||||
|
@ -37,27 +33,4 @@ Package.onUse(function (api) {
|
|||
'lib/routes.jsx'
|
||||
], ['client', 'server']);
|
||||
|
||||
api.addFiles([
|
||||
], ['client']);
|
||||
|
||||
api.addFiles([
|
||||
'lib/server/routes.js',
|
||||
'lib/server/templates.js'
|
||||
], ['server']);
|
||||
|
||||
api.addAssets([
|
||||
'lib/server/emails/common/test.handlebars',
|
||||
'lib/server/emails/common/wrapper.handlebars',
|
||||
'lib/server/emails/comments/newComment.handlebars',
|
||||
'lib/server/emails/comments/newReply.handlebars',
|
||||
'lib/server/emails/posts/newPendingPost.handlebars',
|
||||
'lib/server/emails/posts/newPost.handlebars',
|
||||
'lib/server/emails/posts/postApproved.handlebars',
|
||||
'lib/server/emails/users/accountApproved.handlebars',
|
||||
'lib/server/emails/users/newUser.handlebars',
|
||||
'lib/server/emails/newsletter/newsletter.handlebars',
|
||||
'lib/server/emails/newsletter/newsletterConfirmation.handlebars',
|
||||
'lib/server/emails/newsletter/postItem.handlebars',
|
||||
], ['server']);
|
||||
|
||||
});
|
||||
|
|
32
packages/nova-comments/lib/email_routes.js
Normal file
32
packages/nova-comments/lib/email_routes.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
Telescope.email.routes = Telescope.email.routes.concat([
|
||||
{
|
||||
name: "New Comment",
|
||||
path: "/email/new-comment/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var comment = typeof params.id === "undefined" ? Comments.findOne() : Comments.findOne(params.id);
|
||||
var post = Posts.findOne(comment.postId);
|
||||
if (!!comment) {
|
||||
html = Telescope.email.getTemplate('newComment')(Comments.getNotificationProperties(comment, post));
|
||||
} else {
|
||||
html = "<h3>No post found.</h3>"
|
||||
}
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "New Reply",
|
||||
path: "/email/new-reply/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var comment = typeof params.id === "undefined" ? Comments.findOne() : Comments.findOne(params.id);
|
||||
var post = Posts.findOne(comment.postId);
|
||||
if (!!comment) {
|
||||
html = Telescope.email.getTemplate('newReply')(Comments.getNotificationProperties(comment, post));
|
||||
} else {
|
||||
html = "<h3>No post found.</h3>"
|
||||
}
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
}
|
||||
]);
|
|
@ -18,7 +18,8 @@ Package.onUse(function (api) {
|
|||
]);
|
||||
|
||||
api.use([
|
||||
'nova:notifications@0.25.7'
|
||||
'nova:notifications@0.25.7',
|
||||
'nova:email@0.25.7'
|
||||
], ['client', 'server'], {weak: true});
|
||||
|
||||
api.addFiles([
|
||||
|
@ -30,6 +31,7 @@ Package.onUse(function (api) {
|
|||
'lib/notifications.js',
|
||||
'lib/helpers.js',
|
||||
'lib/custom_fields.js',
|
||||
'lib/email_routes.js',
|
||||
'lib/published_fields.js'
|
||||
], ['client', 'server']);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const renderEmail = (email, key) => {
|
|||
return (
|
||||
<tr key={key}>
|
||||
<td>{email.name}</td>
|
||||
<td><a href={email.path.replace(":_id?", "")} target="_blank"><code>{email.path}</code></a></td>
|
||||
<td><a href={email.path.replace(":_id?", "")} target="_blank">{email.path}</a></td>
|
||||
<td>coming soon…</td>
|
||||
</tr>
|
||||
)
|
3
packages/nova-debug/lib/router.js
Normal file
3
packages/nova-debug/lib/router.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
const Router = FlowRouter;
|
||||
|
||||
export default Router;
|
28
packages/nova-debug/lib/routes.jsx
Normal file
28
packages/nova-debug/lib/routes.jsx
Normal file
|
@ -0,0 +1,28 @@
|
|||
import React from 'react';
|
||||
import Router from './router.js'
|
||||
import {mount} from 'react-mounter';
|
||||
|
||||
import Cheatsheet from './components/Cheatsheet.jsx';
|
||||
import Settings from './components/Settings.jsx';
|
||||
import Emails from './components/Emails.jsx';
|
||||
|
||||
Router.route('/cheatsheet', {
|
||||
name: 'cheatsheet',
|
||||
action() {
|
||||
mount(Telescope.components.App, {content: <Cheatsheet/>});
|
||||
}
|
||||
});
|
||||
|
||||
Router.route('/settings', {
|
||||
name: 'settings',
|
||||
action() {
|
||||
mount(Telescope.components.App, {content: <Settings/>});
|
||||
}
|
||||
});
|
||||
|
||||
Router.route('/emails', {
|
||||
name: 'emails',
|
||||
action() {
|
||||
mount(Telescope.components.App, {content: <Emails/>});
|
||||
}
|
||||
});
|
28
packages/nova-debug/package.js
Normal file
28
packages/nova-debug/package.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
Package.describe({
|
||||
name: "nova:debug",
|
||||
summary: "Telescope debug package",
|
||||
version: "0.25.7",
|
||||
git: "https://github.com/TelescopeJS/telescope.git"
|
||||
});
|
||||
|
||||
Package.onUse(function (api) {
|
||||
|
||||
api.versionsFrom(['METEOR@1.0']);
|
||||
|
||||
api.use([
|
||||
|
||||
// Nova packages
|
||||
|
||||
'nova:core@0.25.7',
|
||||
'nova:posts@0.25.7',
|
||||
'nova:users@0.25.7',
|
||||
'nova:comments@0.25.7'
|
||||
]);
|
||||
|
||||
api.addFiles([
|
||||
'lib/routes.jsx'
|
||||
], ['client', 'server']);
|
||||
|
||||
|
||||
|
||||
});
|
|
@ -1,5 +1,5 @@
|
|||
Package.describe({
|
||||
name: "nova-demo",
|
||||
name: "nova:demo",
|
||||
summary: "Telescope components package",
|
||||
version: "0.25.7",
|
||||
git: "https://github.com/TelescopeJS/telescope.git"
|
||||
|
|
41
packages/nova-email-templates/package.js
Normal file
41
packages/nova-email-templates/package.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
Package.describe({
|
||||
name: "nova:email-templates",
|
||||
summary: "Telescope email templates package",
|
||||
version: "0.25.7",
|
||||
git: "https://github.com/TelescopeJS/telescope.git"
|
||||
});
|
||||
|
||||
Package.onUse(function (api) {
|
||||
|
||||
api.versionsFrom(['METEOR@1.0']);
|
||||
|
||||
api.use([
|
||||
'nova:core@0.25.7',
|
||||
'nova:posts@0.25.7',
|
||||
'nova:users@0.25.7',
|
||||
'nova:comments@0.25.7',
|
||||
|
||||
'dburles:spacebars-tohtml@1.0.1'
|
||||
]);
|
||||
|
||||
api.addFiles([
|
||||
'lib/server/routes.js',
|
||||
'lib/server/templates.js'
|
||||
], ['server']);
|
||||
|
||||
api.addAssets([
|
||||
'lib/server/emails/common/test.handlebars',
|
||||
'lib/server/emails/common/wrapper.handlebars',
|
||||
'lib/server/emails/comments/newComment.handlebars',
|
||||
'lib/server/emails/comments/newReply.handlebars',
|
||||
'lib/server/emails/posts/newPendingPost.handlebars',
|
||||
'lib/server/emails/posts/newPost.handlebars',
|
||||
'lib/server/emails/posts/postApproved.handlebars',
|
||||
'lib/server/emails/users/accountApproved.handlebars',
|
||||
'lib/server/emails/users/newUser.handlebars',
|
||||
'lib/server/emails/newsletter/newsletter.handlebars',
|
||||
'lib/server/emails/newsletter/newsletterConfirmation.handlebars',
|
||||
'lib/server/emails/newsletter/postItem.handlebars',
|
||||
], ['server']);
|
||||
|
||||
});
|
|
@ -2,4 +2,6 @@
|
|||
* @summary Telescope Telescope.email namespace
|
||||
* @namespace Telescope.email
|
||||
*/
|
||||
Telescope.email = {};
|
||||
Telescope.email = {};
|
||||
|
||||
Telescope.email.routes = [];
|
12
packages/nova-newsletter/lib/email_routes.js
Normal file
12
packages/nova-newsletter/lib/email_routes.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
// email test routes (make available to client & server)
|
||||
|
||||
Telescope.email.routes = Telescope.email.routes.concat([
|
||||
{
|
||||
name: "Newsletter",
|
||||
path: "/email/newsletter"
|
||||
},
|
||||
{
|
||||
name: "Newsletter Confirmation",
|
||||
path: "/email/newsletter-confirmation"
|
||||
}
|
||||
]);
|
|
@ -139,4 +139,5 @@ Campaign.build = function (postsArray) {
|
|||
return campaign;
|
||||
};
|
||||
|
||||
export default Campaign;
|
||||
export default Campaign;
|
||||
module.exports = Campaign;
|
22
packages/nova-newsletter/lib/server/email_routes.js
Normal file
22
packages/nova-newsletter/lib/server/email_routes.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Campaign object is only available on server, so define actions on server only
|
||||
|
||||
import Campaign from "./campaign.js";
|
||||
|
||||
_.findWhere(Telescope.email.routes, {name: "Newsletter"}).action= (params, req, res, next) => {
|
||||
var campaign = Campaign.build(Campaign.getPosts(Telescope.settings.get('postsPerNewsletter', 5)));
|
||||
var newsletterEnabled = '<div class="newsletter-enabled"><strong>Newsletter Enabled:</strong> '+Telescope.settings.get('enableNewsletter', true)+'</div>';
|
||||
var mailChimpAPIKey = '<div class="mailChimpAPIKey"><strong>mailChimpAPIKey:</strong> '+(typeof Telescope.settings.get('mailChimpAPIKey') !== "undefined")+'</div>';
|
||||
var mailChimpListId = '<div class="mailChimpListId"><strong>mailChimpListId:</strong> '+(typeof Telescope.settings.get('mailChimpListId') !== "undefined")+'</div>';
|
||||
var campaignSubject = '<div class="campaign-subject"><strong>Subject:</strong> '+campaign.subject+' (note: contents might change)</div>';
|
||||
var campaignSchedule = '<div class="campaign-schedule"><strong>Scheduled for:</strong> '+ Meteor.call('getNextJob') +'</div>';
|
||||
res.end(newsletterEnabled+mailChimpAPIKey+mailChimpListId+campaignSubject+campaignSchedule+campaign.html);
|
||||
}
|
||||
|
||||
_.findWhere(Telescope.email.routes, {name: "Newsletter Confirmation"}).action= (params, req, res, next) => {
|
||||
var confirmationHtml = Telescope.email.getTemplate('newsletterConfirmation')({
|
||||
time: 'January 1st, 1901',
|
||||
newsletterLink: 'http://example.com',
|
||||
subject: 'Lorem ipsum dolor sit amet'
|
||||
});
|
||||
res.end(Telescope.email.buildTemplate(confirmationHtml));
|
||||
}
|
|
@ -26,11 +26,13 @@ Package.onUse(function (api) {
|
|||
// 'package-tap.i18n',
|
||||
// 'lib/collection.js',
|
||||
'lib/callbacks.js',
|
||||
'lib/custom_fields.js'
|
||||
'lib/custom_fields.js',
|
||||
'lib/email_routes.js'
|
||||
], ['client', 'server']);
|
||||
|
||||
api.addFiles([
|
||||
'lib/server/cron.js',
|
||||
'lib/server/email_routes.js',
|
||||
'lib/server/methods.js'
|
||||
], ['server']);
|
||||
|
||||
|
|
30
packages/nova-posts/lib/email_routes.js
Normal file
30
packages/nova-posts/lib/email_routes.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
Telescope.email.routes = Telescope.email.routes.concat([
|
||||
{
|
||||
name: "New Post",
|
||||
path: "/email/new-post/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var post = typeof params.id === "undefined" ? Posts.findOne() : Posts.findOne(params.id);
|
||||
if (!!post) {
|
||||
html = Telescope.email.getTemplate('newPost')(Posts.getNotificationProperties(post));
|
||||
} else {
|
||||
html = "<h3>No post found.</h3>"
|
||||
}
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Post Approved",
|
||||
path: "/email/post-approved/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var post = typeof params.id === "undefined" ? Posts.findOne() : Posts.findOne(params.id);
|
||||
if (!!post) {
|
||||
html = Telescope.email.getTemplate('postApproved')(Posts.getNotificationProperties(post));
|
||||
} else {
|
||||
html = "<h3>No post found.</h3>"
|
||||
}
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
}
|
||||
]);
|
|
@ -22,9 +22,10 @@ Package.onUse(function (api) {
|
|||
]);
|
||||
|
||||
api.use([
|
||||
'nova:notifications@0.25.7'
|
||||
'nova:notifications@0.25.7',
|
||||
'nova:email@0.25.7'
|
||||
], ['client', 'server'], {weak: true});
|
||||
|
||||
|
||||
api.addFiles([
|
||||
'lib/config.js',
|
||||
'lib/collection.js',
|
||||
|
@ -34,6 +35,7 @@ Package.onUse(function (api) {
|
|||
'lib/helpers.js',
|
||||
'lib/published_fields.js',
|
||||
'lib/callbacks.js',
|
||||
'lib/email_routes.js',
|
||||
'lib/methods.js'
|
||||
], ['client', 'server']);
|
||||
|
||||
|
|
31
packages/nova-users/lib/email_routes.js
Normal file
31
packages/nova-users/lib/email_routes.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
Telescope.email.routes = Telescope.email.routes.concat([
|
||||
{
|
||||
name: "New User",
|
||||
path: "/email/new-user/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var html;
|
||||
var user = typeof params.id === "undefined" ? Meteor.users.findOne() : Meteor.users.findOne(params.id);
|
||||
var emailProperties = {
|
||||
profileUrl: Users.getProfileUrl(user),
|
||||
username: Users.getUserName(user)
|
||||
};
|
||||
html = Telescope.email.getTemplate('newUser')(emailProperties);
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Account Approved",
|
||||
path: "/email/account-approved/:_id?",
|
||||
action: (params, req, res, next) => {
|
||||
var user = typeof params.id === "undefined" ? Meteor.users.findOne() : Meteor.users.findOne(params.id);
|
||||
var emailProperties = {
|
||||
profileUrl: Users.getProfileUrl(user),
|
||||
username: Users.getUserName(user),
|
||||
siteTitle: Telescope.settings.get('title'),
|
||||
siteUrl: Telescope.utils.getSiteUrl()
|
||||
};
|
||||
var html = Telescope.email.getTemplate('accountApproved')(emailProperties);
|
||||
res.end(Telescope.email.buildTemplate(html));
|
||||
}
|
||||
}
|
||||
]);
|
|
@ -13,6 +13,10 @@ Package.onUse(function (api) {
|
|||
'nova:core@0.25.7'
|
||||
]);
|
||||
|
||||
api.use([
|
||||
'nova:email@0.25.7'
|
||||
], ['client', 'server'], {weak: true});
|
||||
|
||||
api.addFiles([
|
||||
// 'package-tap.i18n',
|
||||
'lib/namespace.js',
|
||||
|
@ -23,6 +27,7 @@ Package.onUse(function (api) {
|
|||
'lib/callbacks.js',
|
||||
'lib/helpers.js',
|
||||
'lib/published_fields.js',
|
||||
'lib/email_routes.js',
|
||||
'lib/methods.js'
|
||||
], ['client', 'server']);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue