remove unnecessary callback arg/check from send-email.js

This commit is contained in:
cleverbeagle 2017-09-30 08:31:57 -05:00
parent 9116780d3a
commit b4165ed5ca

View file

@ -1,3 +1,4 @@
import { Meteor } from 'meteor/meteor';
import { Email } from 'meteor/email'; import { Email } from 'meteor/email';
import getPrivateFile from './get-private-file'; import getPrivateFile from './get-private-file';
import templateToText from './handlebars-email-to-text'; import templateToText from './handlebars-email-to-text';
@ -5,14 +6,16 @@ import templateToHTML from './handlebars-email-to-html';
const sendEmail = (options, { resolve, reject }) => { const sendEmail = (options, { resolve, reject }) => {
try { try {
Meteor.defer(() => Email.send(options)); Meteor.defer(() => {
if (callback) resolve(); Email.send(options);
resolve();
});
} catch (exception) { } catch (exception) {
reject(exception); reject(exception);
} }
}; };
export default ({ text, html, template, templateVars, ...rest }, callback) => { export default ({ text, html, template, templateVars, ...rest }) => {
if (text || html || template) { if (text || html || template) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
sendEmail({ sendEmail({