nuxt-mail
Version:
Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.
11 lines • 347 B
JavaScript
export default options => {
if (!options.smtp) {
throw new Error("SMTP config is missing.");
}
if (options.message.length === 0) {
throw new Error("You have to provide at least one config.");
}
if (options.message.some(c => !c.to && !c.cc && !c.bcc)) {
throw new Error("You have to provide to/cc/bcc in all configs.");
}
};