0.1.4 • Published 3 years ago

@dynejs/mail v0.1.4

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

Dyne Mail

A simple mail on top of nodemailer with css extracting.

Usage:

const { Mailer, nodeMailer } = require('@dynejs/mail')

const mailer = new Mailer({
    url: 'http://localhost',
    host: 'smpt.mailtrap.io',
    port: '2525',
    user: 'user',
    pass: 'password',
    secure: false,
    driver: nodeMailer
})

await mailer.send({
    to: 'test@user.com',
    from: 'sender@user.com',
    subject: 'Test email',
    content: `
        <style>
        .wrapper {
            padding: 20px;
        }
        </style>
        <div class="wrapper">Content</div>
    `
})

The css classes will be transformed into styles on the content property:

<div class="wrapper" style="padding: 20px;">Content</div>