Retrieving Delivery Steps for SMS/MMS via Twilio REST API - rest

Is it possible via the Twilio REST API to retrieve the Delivery Steps (like you can see on Message Details on the Message Log)? If it is not possible via the REST API, is there a programmatic way to get it (apart from screen scraping)?
I'm using the C# Twilio NuGet package, but I can also hit the REST API directly if necessary. I didn't see Delivery Steps in documentation for either or by visually inspecting JSON results. I also cannot get the Delivery Steps in the CSV export.

Twilio developer evangelist here.
Whilst you can't get that detail from the REST API, messages in Twilio can notify you of their status as it changes.
When you send a message, just set a StatusCallback parameter and Twilio will send you an HTTP POST request when the message status changes into any of the following states: queued, failed, sent, delivered, or undelivered.

Related

Forward SMS from Twilio to Email using Zoho Deluge

As far as I know, you can't forward SMS messages to an email address with just a TwiML Bin. Therefore, I would like to forward Twilio SMS messages to my Zoho email address using Zoho Deluge (instead of the other alternatives I've seen: Google Apps Script or SendGrid).
I intend to use the free Zoho Deluge plan. I have never used Deluge before. This question is intended to help me discover whether Deluge can be a replacement for Google Apps Script for simple functionality like this where a form is not needed.
The basic way to send an email using Deluge is shown here.
I hope Deluge can do the same thing Google Apps Script can do.
Twilio developer evangelist here.
To forward an SMS that is sent to your Twilio number you need to be able to receive an incoming HTTP request.
Zoho Deluge appears to allow you to create functions that can be invoked. However, the methods by which you can invoke a Deluge function do not include via an incoming HTTP request.
I'm not familiar with Deluge, but after a bit of navigating around the documentation I don't believe you can set up a URL that will invoke a function, therefore you can't use Deluge to forward incoming SMS messages with Twilio. As Alan suggests in the comments, you could use Twilio Functions to achieve this without reaching out to another service.

How to receive message stanza without sending self presence?

I am using mongooseim with Android and Ios application. I just want to receive message from the server from background without sending self presence to anyone because this task is done by system. But I can't receive message stanza until I send my presence to the mongooseIM.
Do I missing something or there is a way by which I can get quick update from MongooseIM server in the background without sending presence?
As far as I understand you all you want to do is sync the messages when you receive a Push Notification. MongooseIM can be configured to serve a simple HTTP API with which you can get archived messages (mod_mam needs to be enabled) without establishing the XMPP connection. More details can be found in the HTTP API doc, especially the Swagger doc regarding get messages. Let me know if this suites you.

Mail notification from denormalized view in CQRS

I want to develop a mail notification service to send order approval to customer. The order data is in the denormalized view (query side) and it should be filled to the mail template. Then, we send the email in html string format via mail notification service. But, the order status should be changed to "order approval email sent".
I also try to implement the CQRS, ES, and DDD concept in microservices architecture.
Is this procedure correct and still align with the concept?
Develop HTTP POST API in order command to send approval mail so the order status could be changed in command-side.
The command side generate the event "order approval mail processed"
The event processor process the event. It should get the order data from query-side / denormalized view.
The event processor generates the approval mail from the data and fill the data to the template.
The event processor call HTTP POST to the mail notification service with mail body (html format) in the payload.
The event processor call HTTP PUT to the order service (command-side) to change the order status to "order approval mail sent".
But, if this procedure is applied, the user can't get the response "mail sent" in real-time. How to trigger the client / front-end side that the mail is successfully sent? So, the client side don't have a need to refresh or retry many calls to the API.
Thanks.
I've written a post on this subject a while ago, you can find it here: How to Send Emails the Right Way in a CQRS System
The short version is that I would use a process manager. A process manager listens to events and can issue commands as a result of these events. Just make sure you have a mechanism to not re-send emails if you ever re-run your events.
Regarding the UI. I have another post dealing with this question. You can find it here: 4 Ways to Handle Eventual Consistency on the UI
Here is a short answer. How often do you think once the code is run to send the email, that the email fails to send? Assuming you have a reasonably robust system, I would hope the vast majority of the time it would work. So fake it. And only if there is a problem find some way to notify the user and or admin users. If you want to get fancy you can use things like Signalr or some pub-sub framework for sending messages to the UI.
Anyway - hope that helps.

How to transform a HTTP POST to an email?

I use a mail service which can send HTTP POST requests to a URL with information about failed messages. What I would really like is to get an email about any failed messages.
Are there websites (URLs) that can accept HTTP POST requests and translate them into emails? Or other reasonable easy to implement solutions to convert the mail service's HTTP POSTs into email notifications?
[This is just for my own personal 1-user use; so I don't need a solution that scales well or is able to process vast numbers of HTTP POST requests or anything of that sort.]
An easy way would be to use PHP to read the POST with
$_POST["yourPostedStuffHere"];
and send the data via mail with
mail(to,subject,message,headers,parameters);
See http://www.w3schools.com/php/php_forms.asp and http://www.w3schools.com/php/func_mail_mail.asp
It's not very beautiful, but for personal use it would work.
To answer your question, the web / integration service Zapier can accept incoming webhooks to trigger emails i believe.
They offer services to interconnect several different apps, including sending/receiving webhooks, as well as emails.

sendgrid email via X-SMTP

I am trying to figure out how can I make it possible to send an email from my
application to Sendgrid and have it come back.
I want to use coldfusion to send an email using X-SMTP API. I found a documentation
online here but still wondering if there's any documentation available other
than the web API one?
http://thehatrack.net/blog/integrating-sendgrid-with-your-coldfusion-application/
SendGrid's Event Webhook is the only way to get email reads on an individual basis. This will POST an event to your server every time an email is read (among several other events).
The only "pull" based solution to get individual email events from SendGrid is the bounces endpoint, which will tell you when an email bounces (and is certainly not read), but nothing else.
If you want to retrieve individual read events from SendGrid, you'll need to connect the Event Webhook to an external service like Keen.io, and then leveraging their API to get individual events.