Mailgun, fore example, expects multiple “to” keys in the json payload for batch sending emails to multiple recipients via a single API call.
But Particle appears to overwrite key:value pairs if the same key is used multiple times.
See example below…
Anyway around this?
JSON:
{
"event": "mailgun",
"url": "https://api.mailgun.net/v3/sandboxXXXXXXXXXXXXXX.mailgun.org/messages",
"requestType": "POST",
"mydevices": true,
"auth": {
"username": "api",
"password": "key-XXXXXXXXXXXXXXXXXXXXxxxx"
},
"noDefaults": true,
"form": {
"to": "mary@gmail.com",
"to": "joe@gmail.com",
"from": "Mailgun < mailgun@sandboxXXXXXXXXXXXXXXXXX.mailgun.org >",
"subject": "{{s}}",
"html":"{{1}}"
}
}
Result:
% particle webhook create mailgun.json
Using settings from the file mailgun.json
Sending webhook request { uri: '/v1/webhooks',
method: 'POST',
json:
{ event: 'mailgun',
url: 'https://api.mailgun.net/v3/sandboxceXXXXXXXXXXXXXXXX.mailgun.org/messages',
deviceid: undefined,
requestType: 'POST',
mydevices: true,
auth:
{ username: 'api',
password: 'key-XXXXXXXXXXXXXXXXXXXXXX },
noDefaults: true,
form:
{ to: 'Joe < joe@gmail.com >',
from: 'mailgun < mailgun@sandboxceXXXXXXXXXXXXXXX.mailgun.org >',
subject: '{{s}}',
html: '{{1}}' } },
headers: { Authorization: 'Bearer XXXXXXXXXXXXXXXXXXXXXX' } }
Successfully created webhook with ID XXXXXXXXXXXXXXXXXXXXX


