How to get the last email sent with the Mandrill API - ruby-on-rails

I would like to know if there's way to get the last email send with the Mandrill API?
I looked over the documentation but I didn't find any method to do that.

You should be able to use this call to get recently sent message meta data:
https://mandrillapp.com/api/docs/messages.JSON.html#method=search
And then this one to get the full message content for a given message:
https://mandrillapp.com/api/docs/messages.JSON.html#method=content

Related

Twilio API get DateSent from StatusCallback URL?

I am using Twilio and I want to get the DateSent parameter of a message. When the message is initially sent it has null values for both DateCreated and DateSent. So I pass a StatusCallback URL to receive any status updates on that message. However, I am able to get only the new statuses the message gets such as sent, or delivered and not the new date as an event. In the docs I couldn't find anything about this either (https://www.twilio.com/docs/sms/send-messages#monitor-the-status-of-your-message). What is the way to get this information without continuously polling the API?
The date created is included as part of the response from the API. If you find that is not the case can you please post example code.
When the sms is actually sent you can pull the message resource using the api or sdk via the sid https://www.twilio.com/docs/sms/api/message-resource#fetch-a-message-resource

Graph API for Outlook message restore

I had taken backup of my mail box using below rest API
GET https://graph.microsoft.com/v1.0/me/messages
But from My side this email msg deleted and i want to restore it again .
How i can do it using Rest API.
I tried with
POST https://graph.microsoft.com/v1.0/me/messages
and body with message.
but the message added as a draft not actual message.
Please help.
That is correct, when you create an email it will always save as draft unless it has been sent.
Try find the returned message id from the message creation POST, then issue a secondary POST to send it:
POST https://graph.microsoft.com/v1.0/me/messages/{id}/send
Ref: message: send

Email sent from Rails to yahoo users not delivered

I'm facing following issue:
I send emails from rails using Mailer, it goes fine to all recipients except users with xxx.yahoo.com account.
I tried sending it using SMPT of
Gmail
SendGrid
In none of the case it is delivered.
It gives me following error message
554 Message not allowed - [PH01] Email not accepted for policy
reasons. Please visit
https://help.yahoo.com/kb/postmaster/SLN5067.html [120]
And when I open their provided link, I see following:
You'll receive an SMTP error or failed delivery message that includes
"554 Message not allowed" when the content of a message you're trying
to send violates Yahoo Mail policies. Content that violates policies
includes; objectionable links, malicious attachments, or bad header
information.
They mentioned about content, so I tried sending simple email (note same email when sent from Mail(mac) client, goes fine)
Hello Mr. Suraj,How are you? Not heard from you for long
time.See you soon.
So, this doesn't looks related to content, so bad header information ?
If its so then, doesn't it a Rails/Mailers issue?
I don't understand how to fix this, any one came across this?
Thank you in advance.

How to re-send a failed SMS with Zenvia in Rails?

I'm using Rails with Zenvia API to send Text Messages to my users.
But if a message fails to send, how could I send the same message without creating a new message ID? Is there a method to it?
Today when I try to send again the same message, it returns "Message with same ID already sent".
Turns out Zenvia API does not have a way to resend messages with same ID. At least not within 24 hours.
The solution I found was to create a token that would serve as a "fake" ID and passed it to the API. If the message for any reason fails to send, I create a new token and send it again.

How do I get email analytics in sendgrid?

I am sending email using sendgrid.
Are there any options in sendgrid to get email analytics (open/bounced/replied emails) for each users email address?
I've done this two ways before:
1) Use SendGrid's Event API to collect and aggregate the data yourself.
2) Use a service like sendwithus on top of your SendGrid account, which will collect your SendGrid analytics for you and provide analytics by recipient, template, segment, etc. They also provide an API and Ruby client.
Once you're logged into SendGrid, navigate to the Stats Dashboard.
You should then be able to see something like this:
I hope this helps.
Yes, There are option available for this, to get the status of individual emails sent via sendgrid.
Send a unique arguments with every email you sent and then later on you can get status of these emails with reference to unique argument.
Some more explanation of your question will help us a-lot to describe you the best possible solution.
i have recently done this work, so if you explain the whole scenario, i will come up with the solution.
There are two ways to get hold of this data:
Use the SendGrid Event Webhook to get near realtime information about every event for every email you send via SendGrid. It works by issuing a POST request to a URL that you specify.
You can then store all this data for consumption later on and it's by far the most granular information you can get. Key/Value stores like Redis are a good option for this, but if you want a simple option to get going, check out the SendGrid EventKit to get up and running quickly.
Or:
Grab the data via the Stats API. This endpoint allows you to grab the numbers you need in a multitude of ways for both main and subuser accounts.
Based on your question, you should investigate the Event Webhook as it will give you most clarity on what happens with each email you send.
You can now use Thinbox to get analytics from Sendgrid, Mailgun, Mandrill, or just by bcc'ing an email address they give you. It's basically like EventKit but for the rest of the ESPs too.

Resources