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