Hi,
I’m stuck with one problem.
I’d like to send Mailjet email with the Airtable Script automation.
I succeed to send a Mailjet SMS with this code :
let inputConfig = input.config(); // the input variables in Airtable
let response = await fetch('https://api.mailjet.com/v4/sms-send', {
method: 'POST',
body: JSON.stringify(inputConfig),
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer Mykey'
},
});
The problem is that, in Mailjet dev API, they said to use this code for sending Mailjet template :
curl -s \
-X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3.1/send \
-H 'Content-Type: application/json' \
-d '{
"Messages":e
{
"From": {
"Email": "pilot@mailjet.com",
"Name": "Mailjet Pilot"
},
"To": o
{
"Email": "passenger1@mailjet.com",
"Name": "passenger 1"
}
],
"TemplateID": 1,
"TemplateLanguage": true,
"Subject": "Your email flight plan!"
}
]
}'
The thing is that I succeeded to do it for the SMS, but in this case, I need to add " --user “$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE” "
The problem is : where should I add this user information ?
In the header like this ‘Authorization’: ‘Bearer Mykey’ ?
Doesn’t work.
I really don’t want to use zapier or integromat, I’ll have to many emails to send.
Thanks by advance for any contributions !