How to use the postmark.sendEmailWithTemplate function in postmark

To help you get started, we’ve selected a few postmark examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AraiEzzra / DDKCORE / backlog / helpers / postmark.js View on Github external
const postmark = require('postmark');

// Send an email:
// TODO change to bootstrapPostmark in which will be use in app.js
const client = new postmark.Client(process.env.POSTMARK_KEY);

postmark.sendEmailWithTemplate = function (mailOptions, callback) {
    client.sendEmailWithTemplate(mailOptions, (err) => {
        if (err) {
            return callback(err);
        }
        return callback(null);
    });
};

postmark.sendMail = function (mailOptions, callback) {
    client.sendEmail(mailOptions, (err) => {
        if (err) {
            return callback(err);
        }
        return callback(null);
    });
};

postmark

Official Node.js client library for the Postmark HTTP API - https://www.postmarkapp.com

MIT
Latest version published 1 month ago

Package Health Score

80 / 100
Full package analysis