Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Use packages from npm and support more FlowRouter forks #97

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/mailer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const TAG = 'mailer';
export const Mailer = {
settings: {
silent: false,
silentRouteAdd: false,
routePrefix: 'emails',
baseUrl: process.env.ROOT_URL,
testEmail: null,
Expand Down
4 changes: 3 additions & 1 deletion lib/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ export default function Routing(template, settings, render, compile) {
const name = Utils.capitalizeFirstChar(template.name);
const routeName = String(type + name);

Utils.Logger.info(`Add route: [${routeName}] at path ${path}`);
if (!settings.silentRouteAdd) {
Utils.Logger.info(`Add route: [${routeName}] at path ${path}`);
}

Picker.route(path, (params, req, res) => action(req, res, params, template));
});
Expand Down
4 changes: 4 additions & 0 deletions lib/template-helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import Utils from './utils';

if (Package['ostrio:flow-router-extra']) {
FlowRouter = require('meteor/ostrio:flow-router-extra').FlowRouter; // this fork doesn't use a global scope
}

// # Template helpers
//
// Built-in template helpers.
Expand Down
6 changes: 4 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import fs from 'fs';
import Path from 'path';
import { htmlToText } from 'meteor/lookback:html-to-text';
var htmlToText = Npm.require('html-to-text');
var juice = Npm.require('juice');

const isDevEnv = process.env.NODE_ENV === 'development';
const majorVersion = parseInt(Meteor.release.split('.')[0], 10);
const minorVersion = parseInt(Meteor.release.split('.')[1], 10);

const isModernMeteor = minorVersion >= 3;
const isModernMeteor = majorVersion > 1 || minorVersion >= 3;

// since meteor 1.3 we no longer need meteor hacks just use the npm version
const sass = (function() {
Expand Down
17 changes: 11 additions & 6 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,35 @@ var where = 'server';

Package.describe({
name: 'lookback:emails',
summary: 'Send HTML emails with server side Blaze templates. Preview and debug in the browser.',
version: '0.7.7',
summary: 'Send HTML emails with server-side Blaze templates. Preview and debug in the browser.',
version: '0.7.8',
git: 'https://github.com/lookback/meteor-emails.git'
});

Npm.depends({
'html-to-text': '4.0.0',
'juice': '4.3.1'
});

Package.onUse(function(api) {

api.versionsFrom('1.0.4');

api.use([
'chrisbutler:[email protected]',
'iron:[email protected]',
'kadira:[email protected]'
'kadira:[email protected]',
'staringatlights:flow-router',
'ostrio:flow-router-extra'
], where, { weak: true });

api.use([
'[email protected]',
'check',
'underscore',
'email',
'sacha:[email protected]',
'meteorhacks:[email protected]',
'meteorhacks:[email protected]',
'lookback:[email protected]_2'
'meteorhacks:[email protected]'
], where);

api.addFiles([
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lookback-emails",
"version": "0.7.7",
"version": "0.7.8",
"description": "`lookback:emails` is a Meteor package that makes it easier to build, test and debug rich HTML emails.",
"repository": {
"type": "git",
Expand Down