I’ve searched these forums as well as Google, but the common line feed escapes don’t seem to work in an email.
I’ve tried: \n\r and “\l”\r and %0D%0A
This is the current text string…
This email was sent by a Particle device and handled by Mailgun… DEVICE-ID2a002a001747373333353132 DATA-VALUE33.948109,-86.069382} DATE-TIME2018-10-23T23:12:14.007Z
To be more readable I’d like it to look like this…
This email was sent by a Particle device and handled by Mailgun…
DEVICE-ID 2a002a001747373333353132
DATA-VALUE 33.948109,-86.069382}
DATE-TIME 2018-10-23T23:12:14.007Z
Just tried it, it just shows up in the message like typed.
So far that’s what everything is doing, except curly brackets double curly brackets seem to escape but so far {{\n}} and {{%0D%0A}} while not providing newlines, the contents between the bracket don’t show up so something’s happening at least.
Sorry to be the guy to suggest “rewrite your architecture” but a possibility would be use the Particle get() function via something like Python which would then make text prettying easy and you could forward the data on your chosen channel.
Since the data will be parsed and processed when it reaches it’s destination, it’s not that important. I just didn’t think it would be that big of a problem to add.
Nope…
This email was sent by a Particle device and handled by Mailgun…\r\n DEVICE-ID: api\n DATA-VALUE: test-event\r\n DATE-TIME: 2018-10-24T10:41:43.559Z
And this…
This email was sent by a Particle device and handled by Mailgun…{{\r\n}} DEVICE-ID: {{{PARTICLE_DEVICE_ID}}}{{\n}} DATA-VALUE: {{{PARTICLE_EVENT_VALUE}}}{{\r\n}} DATE-TIME: {{{PARTICLE_PUBLISHED_AT}}}
Results in this…
This email was sent by a Particle device and handled by Mailgun… DEVICE-ID: api DATA-VALUE: test-event DATE-TIME: 2018-10-24T10:44:18.658Z
It’s not surprising that the handle-bars “escapes” ({{\n\r}}) are not showing up in your mail.
This notation would actually expect a JSON key "\r\n\" in your event value field and substitute it for the JSON value contents.