1.0.2 ā€¢ Published 2 years ago

juicy-emails v1.0.2

Weekly downloads
3
License
MIT
Repository
-
Last release
2 years ago

Juicy Emails šŸ‰

Send emails built from Handlebars templates.

import JuicyEmails from 'juicy-emails';
import mailgun from 'nodemailer-mailgun-transport';
import path from 'path';

const __dirname = path.dirname(new URL(import.meta.url).pathname);
const templates = path.join(__dirname, 'templates');

const email = new JuicyEmails({
  handlebars: {
    templates, // required
    helpers    // optional
  },
  juice: {
    preserveImportant: true,
    webResources: {
      // relativeTo: <defaults to handlebars.templates>
      images: 8
    }
  },
  mailer: {
    send: false, // sets transport to jsonTransport, defaults to true
    from: 'Zeeba <zeeba@gmail.com>', // default from, optional
    transport: mailgun({ // defaults to { jsonTransport: true }
      auth: {
        api_key: '...',
        domain: '...'
      }
    })
  }
});

let res = await email.send({
  from, // defaults to mailer.from
  to: 'larry@gmail.com',
  name: 'hello',
  props: {
    name: 'Larry',
  }
});
templates
ā”œā”€ā”€ hello          -- email name `email.send({ name, ... })`
|  ā”œā”€ā”€ html.hbs    -- html template (required)
|  ā”œā”€ā”€ subject.hbs -- subject line (required)
|  ā””ā”€ā”€ text.hbs    -- plain text template (optional)
ā”œā”€ā”€ partials       -- handlebars partials
|  ā””ā”€ā”€ body.hbs
ā””ā”€ā”€ style.css

Heavily influenced by email-templates. Thank you @niftylettuce

1.0.2

2 years ago

1.0.1

2 years ago

0.0.12

2 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago