I use the appscript to trigger an email via sendinblue, but I need to add an attachment to the code.
I've tried the code below, but the attachment didnt worked. How should I add the attachment parameter in this code?
var data = { "sender": {"name":"xxx","email":"xxx@xxx"},
"htmlContent": "xxx",
"subject": "xxx",
"replyTo":{"email":"xxx@xxx","name":"xxx"},
"to": [{"email": "xxx@xxx"}, {"email": "xxx@xxx"}],
"parameter": [{"name": filexxx.getAs(MimeType.PDF).setName("file.pdf")}]
var options = {
'method': 'post',
'contentType': 'application/json',
'payload': JSON.stringify(data),
'headers': {'api-key':myAccessKey},
};
var response = UrlFetchApp.fetch(url, options);
Logger.log(response.getResponseCode())