I am trying to set up Sendinblue's mail service with Google Apps Script as follows:
code.gs
function sendInBlue(){
eval(UrlFetchApp.fetch('https://cdn.rawgit.com/mailin-api/mailin-api-node-js/master/V2.0/mailin.js').getContentText());
var client = new Mailin("https://api.sendinblue.com/v2.0","your access key");
data = {
"to" : {"to@example.net":"to whom!"},
"from" : ["from@email.com", "from email!"],
"subject" : "My subject",
"html" : "This is the <h1>HTML</h1>"
}
client.send_email(data).on('complete',function(data){console.log(data);});
}
Error message: ReferenceError: "require" is not defined.
The sendinblue node.js library talks about a Restler library also being required, but I'm really not sure how to incorporate this library also? I am a novice so could be completely off-track here.
Any guidance is appreciated.
Documentation:
https://apidocs.sendinblue.com/tutorial-sending-transactional-email/
https://github.com/mailin-api/mailin-api-node-js/tree/master/V2.0