I can also get the webform version to work but cannot get a JSON version to work. Any one know of a way to send a parsable string to a webhook via webform to mailgun? The below was taken from the only partial example I can find. It says to use double brackets to get the sub parts of the PARTICLE_EVENT_VALUE broken out. I have tried 2 and 3 brackets {{subject}} and {{text}}. Mail gun is complaining there is no text field
Output from particle cloud:
// Publish an event to the Particle Cloud, which triggers your Mailgun webhookvoid sendMailgunEmail(String subject, String body) {
// Use a string to concatenate the subject and body for the publish event.
// The webhook was configured to extract 'subject' and 'data' from this.String
eventData = "subject=" + subject + "&data=" + body;
// The first argument is the event name defined in your webhook.
// The second argument is the payload (our combined subject and body).
// PRIVATE ensures the event is not public.
Particle.publish("sendEmail", eventData, PRIVATE);
}
Event
The source event that triggered the webhook
{
"name": "sendEmail",
"data": "subject=\"TestP1\"$data=\"this is data\"",
"ttl": 60,
"published_at": "2025-09-19T13:40:11.617Z",
"coreid": "0a10aced202194944a05a22c"
}
Request
The HTTP request sent to the webhook url
POST /v3/sandboxxxxxxxxxxxxxxxxxxxxxbdd12.mailgun.org/messages HTTP/1.1
User-Agent: ParticleBot/1.1 (https://docs.particle.io/webhooks)
host: api.mailgun.net
content-type: application/x-www-form-urlencoded
authorization: Basic YXBpOmZkN2M2NmFmOTE5ZjI2NDkyMmI0YjMxY2I3NjQxNTZmLTNjMTM0MDI5LTg3NzZkZDAw
content-length: 63
Connection: keep-alive
Response
The HTTP response received from the webhook url
HTTP/1.1 400 Bad Request
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Account-Id: 548e13xxxxxxxxxxxxx8819
Cache-Control: no-store
Content-Length: 97
Content-Type: application/json; charset=utf-8
Date: Fri, 19 Sep 2025 13:41:11 GMT
Strict-Transport-Security: max-age=63072000; includeSubDomains
X-Mailgun-Key-Id: 3c134029-8776dd00
X-Server: influx
X-Xss-Protection: 1; mode=block
{"message":"Need at least one of 'text', 'html', 'amp-html' or 'template' parameters specified"}
Replace subject with “This is the subject” and text with {{{PARTICLE_EVENT_VALUE}}} and it work, the text is the event value. I want to pass both subject and body.
Any ideas?