Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. let { logmailer, Recipient, Chapter, StandardChapters } = require("logmailer");
  2. // import { logmailer, Recipient, Chapter, StandardChapters } from "logmailer";
  3.  
  4. // the order in this object is the order of the chapters in the email
  5. let chapters = {
  6. summary: StandardChapters.Summary,
  7. ffOnly: new Chapter("Firefighter only", false, "DeepPink"),
  8. managerOnly: new Chapter("Manager only", false, "DarkSlateBlue"),
  9. errors: StandardChapters.Errors,
  10. logs: StandardChapters.Logs
  11. }
  12.  
  13. logmailer.create({
  14. appName: "My App",
  15. mailAlias: "myapp@mymail.com",
  16. client: {
  17. host: "smtp.googlemail.com",
  18. user: "user",
  19. password: "password",
  20. ssl: true
  21. },
  22. recipients: [
  23. "baerbel@gmx.de", // receives everything
  24.  
  25. // receives email if the "managerOnly" chapter is not empty
  26. // receives only the chapter "managerOnly"
  27. new Recipient("guenther@gmail.com", [chapters.managerOnly], [chapters.managerOnly]),
  28.  
  29. // receives email if the "ffOnly" chapter is not empty
  30. // receives only the chapters "ffOnly" and "errors"
  31. new Recipient("horst@web.de", [chapters.ffOnly], [chapters.summary, chapters.ffOnly, chapters.errors]),
  32. ],
  33. chapters: chapters
  34. })
  35.  
  36. module.exports.logmail = chapters;
  37. module.exports.logmailer = logmailer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement