totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

mail attachments #768

Closed EmmanuelleZenou closed 3 years ago

EmmanuelleZenou commented 4 years ago

Hello, I am discovering totaljs and new in web dev. I cannot figure how to send a pdf file with an email I send. can someone help me ? Here is my code. I am dying of this issue I met

`NEWSCHEMA("Mails", function (schema) { schema.define("title", "String(80)"); schema.define("object",Object)({})

schema.addWorkflow("exec", function ($) { const model = $.clean() console.log(model) model.email="toto@mail.com" let direction let attachments= [ { name : "smtpjs.png", path : "https://networkprogramming.files.wordpress.com/2017/11/smtpjs.png" }]

if (model.title.includes("job")) direction="/mails/job"
  MAIL(
        model.email,
        model.title,
        direction,
        model,
        "fr", //response.language
      );
      $.success();

})

}) `

Thank you so much