Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let { logmailer, Recipient, Chapter, StandardChapters } = require("logmailer");
- // import { logmailer, Recipient, Chapter, StandardChapters } from "logmailer";
- // the order in this object is the order of the chapters in the email
- let chapters = {
- summary: StandardChapters.Summary,
- ffOnly: new Chapter("Firefighter only", false, "DeepPink"),
- managerOnly: new Chapter("Manager only", false, "DarkSlateBlue"),
- errors: StandardChapters.Errors,
- logs: StandardChapters.Logs
- }
- logmailer.create({
- appName: "My App",
- mailAlias: "myapp@mymail.com",
- client: {
- host: "smtp.googlemail.com",
- user: "user",
- password: "password",
- ssl: true
- },
- recipients: [
- "baerbel@gmx.de", // receives everything
- // receives email if the "managerOnly" chapter is not empty
- // receives only the chapter "managerOnly"
- new Recipient("guenther@gmail.com", [chapters.managerOnly], [chapters.managerOnly]),
- // receives email if the "ffOnly" chapter is not empty
- // receives only the chapters "ffOnly" and "errors"
- new Recipient("horst@web.de", [chapters.ffOnly], [chapters.summary, chapters.ffOnly, chapters.errors]),
- ],
- chapters: chapters
- })
- module.exports.logmail = chapters;
- module.exports.logmailer = logmailer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement