the Official v8.1 Mailgun/Mandrill/MailChimp RESTful thread

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

the Official v8.1 Mailgun/Mandrill/MailChimp RESTful thread

Post by Jaymer »

Join in the fun.
Lets explore v8.1 and see if we can get it working with Mailgun & Mandrill.

MAILGUN
Here's their page on the API: https://documentation.mailgun.com/en/la ... intro.html
FREE to get a Proof of Concept license - 10k emails/month

MANDRILL
https://mandrillapp.com/api/docs/

MAILCHIMP
http://developer.mailchimp.com/documentation/mailchimp/
FREE account to start playing around

Reply here if you want to be active in this topic and lets see how the new REST abilities of 8.1 stack up.

==================================================
LATEST STATUS

MailChimp
I can create a new MC List, and add Custom MERGE fields (FNAME, LNAME, COMPANY, etc.) for that List.
I can upload members to that List.
I can retrieve all Lists for an account.
Then download the members.
Next steps would be to Create a Campaign, have it use my List, and Launch the Campaign. (We decided to make Tenants do these steps manually, since they already do this in MC anyway. This way Aware wouldn't be involved in any mess-ups/premature sending, etc.)

Mandrill
Aug 26: Currently working on Sending a Transactional Email to a list of Recipients, via REST. Tom Ford has done Email Sending using SMTP (non REST).
Aug 28: I was able to get this working. I can select records in a grid (or select all, like All Employees) and I write these to a temp file. I want to send 1 email to all the selected ppl. A SQL Server Stored Procedure (SP) builds my JSON array (Recipient list) and stuffs into a field. Aware builds the JSON string from a template and adds the Recipient list. REST call is done and in 1-2 seconds total time, the emails are queued by mandrill. THE MAJOR PROBLEM THAT HAS FORCED US TO ABANDON THIS is the look of the email when it is opened by the recipient. It might have my name as the From, but the address will show up as OUR domain, not the Tenants company or Domain -- UNLESS you take time to have them alter their DNS records and add stuff so they are verified. Yes, all this is to limit Spam, but we don't want it looking like the email came from "a mailer" or a "system process". The tenant is Acme Inc, and the send from should be [email protected]. Yes, the Reply-To can be set, thats not the issue.
Someone like Tom Ford could use this because all his emails come from their company. They don't have a multi-tenant system. Thats the issue.
We have a competitor who is using MailGun and their outgoing emails look "proper", so we're going that way.
PS _ From using the docs, I still had some issues that needed clarification for us long term. Sent 3 tickets into support - still no word from them 2 days on.
We HAVE a paid account.

Mailgun
Aug 29 - I don't like their docs. Very circular - keep coming back to same place. Was able to figure out Mandrill VERY easily. And I finally realized that they DO NOT take JSON strings, its all HTTP parameterized (I think) unless using NodeJS, Ruby, Java, etc.
Last edited by Jaymer on Wed Aug 29, 2018 4:46 am, edited 5 times in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
customaware
Posts: 2401
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: the Official v8.1 Mailgun/Mandrill RESTful test thread

Post by customaware »

I am a vacant space in terms of that stuff BUT would love to know how.

I use Mandrill to send most of my mail and it is terrific. But would like to receive as well be able to get the stats data.

All ears and eyes....
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: the Official v8.1 Mailgun/Mandrill RESTful test thread

Post by idpSteve »

Always keen to learn :) Not sure how much time I'll have to contribute right now but I'll definitely follow along.
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: the Official v8.1 Mailgun/Mandrill RESTful test thread

Post by aware_support »

Make sure you download the latest beta - a few problems with REST have been fixed.
Aware IM Support Team
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Mandrill Update

Post by Jaymer »

In Mandrill, via Rest (or curl), utilizing "/messages/send.json", it allows you to pass an array of recipients...
In a JSON format, which I can easily do now. Build a big JSON array of many recipients in this format:

Code: Select all

        "to": [
            {
                "email": "[email protected]",
                "name": "Recipient Name",
                "type": "to"
            }
        ],
So that makes it VERY easy to send 1 message to them and out will go a bunch of emails.

Using MailChimp, you have to pre-create a List, then add members to the list, then make a Campaign (yes, just for a single email) telling it to use the List, then Start the Campaign.

Using MailGun, you also create a List and add members to it. Then, you send a regular email to "the List" and it copies/send/distributes it to all members of the List (old-school mailing lists). I thought this was kinda neat, because Aware can maintain the members of the list (and refresh it anytime) and you can just send an Email OUTSIDE of aware to the list and Voila. But I have a few MailGun Q's and their support it closed right now. I'm a bit confused by some omissions in the docs.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

REST to Mandrill

Post by Jaymer »

I'm able to send an Email to hundreds of users in 1-2 seconds.
That includes build 2 LONG JSON strings for Mandrill.
I build these with complex MS SQL SPs. The string was 26,000 bytes for and email to 400 ppl.
And If you want a Merge variable, even just 1 field FNAME, you have to build ANOTHER long JSON string with all the same email addresses AGAIN and a funky array with the Variable name & content. Fortunately, all that builds instantly for me - I can't imagine how long it would take to build it natively "IN BATCHES OF 1" or calling Aware/REST to build the string.

Had just started the Callbacks/Webhooks to get open/clicked/Unsub details when we abandoned this due to a domain verification issue - I explained that up above in the 1st post "Latest Status"
Last edited by Jaymer on Wed Aug 29, 2018 4:44 am, edited 3 times in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: the Official v8.1 Mailgun/Mandrill/MailChimp RESTful thr

Post by tford »

After sending AwareIM emails via Mandrill's SMTP capability, it would be very valuable to be able to receive info back into my AwareIM apps about the actions taken by the read of the email ... read receipt, link clicked, etc. This info would be super valuable to be able to trigger additional steps in our CRM system ... schedule phone calls to be made, trigger a follow-up e-mail, etc.

The challenge is that even with 8.1 new REST capabilities, I don't see that it's possible to set up a service in AwareIM to receive JSON formatted event info via Mandrill Webhooks. If I understand it correctly, AwareIM can read and process JSON that is received when AwareIM sends a call to an outside service, but AwareIM can not read JSON coming into Service exposed by AwareIM. Calls from the outside into an AwareIM Service have to be parameterized if I understand it correctly.

Am I missing something?

Details on Mandrill Webhooks:
url]https://mandrill.zendesk.com/hc/en-us/a ... o-Webhooks[/url]

https://mandrill.zendesk.com/hc/en-us/a ... ook-Format
Tom - V8.8 build 3137 - MySql / PostGres
customaware
Posts: 2401
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: the Official v8.1 Mailgun/Mandrill/MailChimp RESTful thr

Post by customaware »

Top question Tom.

I have been wanting to do this for ages.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: the Official v8.1 Mailgun/Mandrill/MailChimp RESTful thr

Post by tford »

I have been wanting to do this for ages.
Same here, Mark. I've been beating this drum for a while. Maybe I'm wrong, but it seems like from a technology point of view within AwareIM, we are VERY close since JSON can be read. Seems like it's just a matter of incorporating that logic into the services exposed by AwareIM as well.
Tom - V8.8 build 3137 - MySql / PostGres
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: the Official v8.1 Mailgun/Mandrill/MailChimp RESTful thr

Post by Jaymer »

Tom & Mark
I was coming to the same conclusion at the same time as these posts. While posting emails via JSON seems straightforward, I was prepping for a callback from Mandrill because I'm really interested in handling UNSUB events. And, as Tom pointed out, the callback can't be handled by Aware if they send JSON.

The simplest thing (and I haven't done this before) will be using a Node.js process to receive the data and post it to SQL SERVER (or any database, for that matter).

No reason to hold out or wait for Aware to modify its stuff... I'll be doing this by the end of this week.

Jaymer...
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: the Official v8.1 Mailgun/Mandrill/MailChimp RESTful thr

Post by Jaymer »

UPDATE
... on getting callback data into Aware

Am using Bandwidth for SMS messaging.
SENDING: w.r.t SMS, I don't much care about actual delivery receipt info, so I have my alert level set to "error" when sending. If a msg isn't delivered, I'll get a JSON msg at my Node.js server. Am not processing this yet except to reply with a 200 - OK

INCOMING SMS: When someone sends a msg to one of the Users' phone #s setup in bandwidth, that ReceiveSMS application calls my Node.js server and is processed. An incoming packet looks like this:

Code: Select all

{ messageId: 'm-echiany4pxxsa',
  from: '+18132940000',
  eventType: 'sms',
  text: 'Yes i got it',
  time: '2018-12-19T04:21:44Z',
  to: '+19163470000',
  state: 'received',
  messageUri:
   'https://api.catapult.inetwork.com/v1/users/u-a6gzr3i6avrrq/messages/m-echiajzny4pxxsa',
  applicationId: 'a-je3pu3kw2zsrafifey',
  direction: 'in' }
I'm using info from there to make this URL call to Aware:

Code: Select all

https://mysite.com/R3/logonOp.aw?domain=AA&userName=SMS&password=aaa&testingMode=true&firstCommand=startProcessWithInit,SMS,main,MessageLog&fromNumber=813-294-0000&toNumber=9163470000&body=Yes%20i%20got%20it&status=stage1&direction=inbound
which logs in to Aware, creates the SMS incoming record MessageLog, where a Rule:
IF MessageLOG IS NEW THEN "do stuff"
processes it and links it to the senders account.
It also looks up the recipient (the user) and forwards a SMS msg to a phone if desired.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply