SendGrid - Custom Event Notification App in header - ruby-on-rails

I am trying to use SendGrid's Event Notification App (http://sendgrid.com/documentation/display/apps/EventNotification) for emails of certain categories. The Event Notification on my SendGrid account is empty. The header I'm putting on my email is:
X-SMTPAPI: {"category":"category","filters":{"eventnotification":{"settings":{"url":"theurl"}}}}
But I'm not getting a callback on my url. A simple curl post on this given url gives me the expected output, so I'm pretty sure that should be working with SendGrid too.
Do you have any ideas on what the header should look like? I couldn't find too much documentation on the website for this specific app...
Thanks!

Here is an example of the header that I am successfully sending with my Sendgrid emails:
headers("X-SMTPAPI" => "{\"unique_args\": {\"customer_id\":\"#{customer.id}\",\"email_batch_id\":\"#{batch_id}\"}, \"category\":\"monthly_statement\"}")
Make sure you have the correct events checked under the event notification settings in Sendgrid.

Related

Remove Mandrill footer

I'm sending emails using the Mandrill API, Is there any way to remove their footer or edit it enter image description here
as I wanted to use my unsubscribe url instead
You can turn it off by their settings ! as the following image :

Build a Windows phone chat app with Post and Get request

I am supposed to create a simple chat app using httppost and get in order to send message and to get message.
This is what I am supposed to get after sending the request to the API:
{"conversation":
{"id":35,"created_at":"2014-11-16T19:21:11.000+01:00",
"updated_at":"2014-11-16T19:21:11.000+01:00",
"conversation_type":null,"option_id":null,
"messages":[
{"body":"lol","created_at":"2014-11-16T19:21:13.000+01:00","user_id":34},
{"body":"payday","created_at":"2014-11-16T19:25:57.000+01:00","user_id":34},
{"body":"lol","created_at":"2014-11-16T20:19:26.000+01:00","user_id":34},
{"body":"izi","created_at":"2014-11-17T01:09:36.000+01:00","user_id":34},
{"body":"LOWL","created_at":"2014-11-17T01:11:34.000+01:00","user_id":34}
],
"users":[
{"id":34,"email":"zegfault42#gmail.com","first_name":"Hugo","name":"Barbier"},
{"id":36,"email":"ismael.bourg#gmail.com","first_name":"Ismael","name":"Bourg"}
]
}
}
And I am supposed to make a post request in order to reply message. I just want to know what I can do and how I can design it.
Please read more about HTTP Post & Get methods, REST services.
It is very simple. You can find it on the internet.
Also, I had similar questions when I started developing.
Check the answer to my question here-
Request & Response Windows Phone
Hope this helps

Sending message with custom URL though Geoloqi

I'm looking into Geoloqi as a service for sending messages and I'm wondering about the url parameter described here:
https://developers.geoloqi.com/api/message/send
Can I use a custom protocol/URL scheme to launch my app in response to a sent message.
(I would assume yes, but need to be sure before progressing further with it).
According to the web page you've linked, one of the parameters that can be sent along with the "POST" is a URL that can be opened when the notification is tapped.
It's here that I think you could put your custom URL. No way to know if the server will accept a custom scheme (e.g. "bradrobinson://hi/there") though without trying.

How to send background email after button press?

I'm building an internal app. I want to be able to press a button, and have the app automatically send a predefined email message to a specified email address, without the user knowing. I have access to a web-server, but I'm just not quite sure on what the best way to go about doing this is.
I'm using storyboard in xcode, this is a singleview application for the ipad.
Any suggestions are greatly appreciated.
You can create a PHP script that can do this (code below). Use a library such as ASIHTTPRequest to post the user's email address to the script and then the script will automatically send the message.
<?php
$to = $_POST["email"]; //this is the user's address; you can replace $_POST["email"] with "user#example.com" to try it out
$subject = "Subject";
$body = "Message";
$headers = "From: Name <noreply#example.com>\r\n" . "X-Mailer: php";
if (mail($to, $subject, $body, $headers)) {
//sent
}
?>
If you want to use the user's mail account that they have set up in the mail.app - you can't do that without the MFMailComposeViewController.
Solutions are:
Use some Framework or roll your own mail solution that you or the user fills with their respective mail acc data and then send mails.
or
Write a little PHP/Ruby/Java/... script that sends a mail which you can trigger via web request (i.e. REST).
SKPSMTPMessage works well for sending emails without the need for a UI.
(Make sure you add a reference to the CFNetwork.framework in your project.)

Is it possible to create an MMS which contains a url link to launch a local app

I can launch my app if I embed a url in an SMS and then the user clicks on the url from within the message app. I have this all working.
What I would like to be able to do however is send an MMS to the device which contains a number of image(s) and text filling the screen and when the user clicks on the url within the MMS my app is launched same as it is if clicked from within an SMS.
Is it possible to mock this up so I can see it working? i.e. how could I create an MMS containing a working active link to demo a proof of concept (I'm not talking about creating an MMS programatically on iOS, just how to create one containing my app's url to send to the device)?
Edit: This answer was written under the assumption that implementation details were required for the URL handling part. I'll leave the technical details here for future Googlers.
Here is a link to a forum thread which seems to indicate you can't send MMSes from the iPhone programmatically (I know you said you didn't want to know this anyway, but it's here for completeness). The suggestion is to use a message provider's MMS gateway directly (e.g http://www.smsglobal.com).
Instructions on how to get a hyperlink into an MMS are here. You can just write it in plain text, or use an anchor: <a href="myapp://"> Not 100% sure the iPhone will properly parse those anchor tags in an MMS though.
Read this article. The gist is that you add a "URL types" row to your Info.plist and set it to any valid protocol, say myapp, and then a user opens a link in an MMS to a myapp URL. Article excerpt:
myapp://
myapp://some/path/here
myapp://?foo=1&bar=2
myapp://some/path/here?foo=1&bar=2
The iPhone SDK, when launching the application in response to any of the URLs above, will send a message to the UIApplicationDelegate.
If you want to provide a custom handler, simply provide an implementation for the message in your delegate. For example:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
// Do something with the url here
}

Resources