We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See here:
import { Email } from 'meteor/email'; import getPrivateFile from './get-private-file'; import templateToText from './handlebars-email-to-text'; import templateToHTML from './handlebars-email-to-html'; const sendEmail = (options, { resolve, reject }) => { try { Meteor.defer(() => Email.send(options)); if (callback) resolve(); } catch (exception) { reject(exception); } }; export default ({ text, html, template, templateVars, ...rest }, callback) => { if (text || html || template) { return new Promise((resolve, reject) => { sendEmail({ ...rest, text: template ? templateToText(getPrivateFile(`email-templates/${template}.txt`), (templateVars || {})) : text, html: template ? templateToHTML(getPrivateFile(`email-templates/${template}.html`), (templateVars || {})) : html, }, { resolve, reject }); }); } throw new Error('Please pass an HTML string, text, or template name to compile for your message\'s body.'); };
Expecting a callback but returns a Promise so the callback would be the resolve() invocation.
resolve()
The text was updated successfully, but these errors were encountered:
6640da8
cleverbeagle
No branches or pull requests
See here:
Expecting a callback but returns a Promise so the callback would be the
resolve()
invocation.The text was updated successfully, but these errors were encountered: