Getting mailgun to work on the Particle Platform

I would like to use mailgun to send emails when sensors are read at certain levels. I have used IFTTT and PushingBox with success but would rather like to implement mailgun to handle the emails. On their website they list examples but none in C or C++.

A curl example:
*curl -s --user ‘api:YOUR_API_KEY’ *
*https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages *
*-F from=‘Excited User <mailgun@YOUR_DOMAIN_NAME>’ *
*-F to=YOU@YOUR_DOMAIN_NAME *
*-F to=bar@example.com *
*-F subject=‘Hello’ *
-F text='Testing some Mailgun awesomness!'
A Java example:
public static ClientResponse SendSimpleMessage() {
Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter(“api”,
“YOUR_API_KEY”));
WebResource webResource =
client.resource(“https://api.mailgun.net/v3/YOUR_DOMAIN_NAME” +
"/messages");
MultivaluedMapImpl formData = new MultivaluedMapImpl();
formData.add(“from”, “Excited User <mailgun@YOUR_DOMAIN_NAME>”);
formData.add(“to”, "bar@example.com");
formData.add(“to”, “YOU@YOUR_DOMAIN_NAME”);
formData.add(“subject”, “Hello”);
formData.add(“text”, “Testing some Mailgun awesomness!”);
return webResource.type(MediaType.APPLICATION_FORM_URLENCODED).
post(ClientResponse.class, formData);
}

Need help in converting either one to work in the Particle platform. I do not know how to start the conversion. For example how do I convert the first two lines of the Java example:

public static ClientResponse SendSimpleMessage() {
Client client = Client.create();

Thanks.

Have you created your Mailgun account?

You should read up on Particle webhooks. I am using Mailgun in two different applications to send emails. It isn’t exactly what I would call straightforward but it is certainly doable. There are many different ways to do things depending on how sophisticated your needs are.