mail attachments
Closed this issue · 0 comments
EmmanuelleZenou commented
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