We need to send out thousands of emails per day via ActionMailer in our Rails app. These will be sent upon receipt of user interaction in our app. Gmail Enterprise limits at 2,000 per day, this simply will not be enough for us, and thus we cant use it.
GMail isn't intended or appropriate for large amounts of bulk mail. At the volumes you want to send, you need a dedicated provider designed for buik mailings. There's plenty of providers that do this, but SendGrid is a popular option, and can handle very large volumes.
Related
Rails 6 comes with Action Mailbox now. The documentation and community do not have great resources on how to integrate various services outside of the most common such as SendGrid.
Assuming a person uses Google's Gsuite Gmail:
How could they integrate that with Action Mailbox?
Would one use Gmail's API, or would that not be appropriate for Action Mailbox?
If Gmail doesn't work, what is different about SendGrid that makes it integrate appropriately?
Action Mailbox is built around receiving email from a Mail Transfer Agent (MTA) in real time, not periodically fetching email from a mailbox. That is, it receives mail sent via SMTP, it doesn't fetch mail (using IMAP or POP3) from another server that has already received it.
For this to work it is dependent on an external (to Rails) SMTP service receiving the email and then delivering the email to Action Mailbox. These external services are called "Ingresses" and, as at the time of writing, there are 5 available ingresses.
Of the five, four are commercial services that will run the required SMTP servers for you and then "deliver" the email to your application (usually as a JSON payload via a webhook).
Mailgun - scroll down to "Inbound"
Mandrill
Postmark
Sendgrid
You could already use those services in a Rails App and handle the webhooks yourself but Action Mailbox builds a standardised set of functionality on top. Almost like a set of rails to guide and speed the process.
In addition, the fifth ingress is the "Relay" ingress. This allows you to run your own supported MTA (SMTP server) on the same machine and for it to relay the received email to Action Mailbox (usually the raw email). The currently supported MTAs are:
Exim
Postfix
Qmail
To answer your specific questions about Gmail:
How could they integrate that with Action Mailbox?
They couldn't directly. They would need to also set up one of the 7 MTAs listed above and then somehow deliver the emails to that. The delivery could be accomplished with:
Forwarding rules managed by the user at the mailbox level
Dual delivery, split delivery or some other advanced routing rule managed by the admin at the domain level
Would one use Gmail's API, or would that not be appropriate for Action Mailbox?
Even if there were a way to have Gmail fire a webhook on incoming email (I'm not aware of any special delivery options outside the advanced routing rules above), there is currently no way to connect that theoretical webhook to Action Mailbox.
If Gmail doesn't work, what is different about SendGrid that makes it integrate appropriately?
Sendgrid (to use your example, the others work more or less the same way) offers an inbound mail handling API. Just as importantly, the Rails Team has built an incoming email controller to integrate with that API.
Given the lack of Gmail APIs and the lack of a Rails ingress controller, the only way I can think of that you could connect Action Mailbox to an existing Gmail mailbox would be for some other bit of code to check the mailbox, reformat the fetched email and then pose as one of the supported MTAs to deliver it to Action Mailbox.
It would be an interesting exercise and would possibly become a popular gem but it would very much be a kludge. A glorious kludge if done well, but a kludge nonetheless.
Another option would be to leave your example.com domain delivering to Gmail as normal and set up another domain for your Action Mailbox emails. You could use a separate domain, example.org, or a subdomain, app.example.com.
This would involve setting up one of the 7 supported SMTP servers and pointing the MX records for example.org or app.example.com at those servers.
Bonus trivia: Another name for an MTA is a Mail eXchager, hence the name for a DNS mail record is an MX record.
To integrate IMAP with Rails, have a look into the greate mail_room Gem
It's a daemon that you can start alongside your app, which listens onto couple of IMAP inboxes, and then convert those into either a Sidekiq Worker or push it via http to your app.
It's used by Gitlab for their mail interactions (Answer to thread, create issue by writing to an email).
They also have a section on how to integrate with ActionMailbox.
If you were dead set on doing this, Gmail has had IMAP IDLE (push) support since day one.
It would be quite easy to write a small daemon that watches a Gmail inbox and calls the rails action mailbox webhook endpoint with a properly formatted JSON payload.
I read the guidelines and I have a problem with "Consistent history of sending a high volume of mail from your domain (order of hundred emails a day minimum to Gmail) for a few weeks at least." The thing is, I need RSVP buttons for an internal application that manages leaves and holidays, and the particular email address we created for our app does not send any other messages. So I can't possibly send "hundreds of emails" in order to prove that I'm not spamming anyone. If I describe the situation in the registration form, can I get a pass?
#SilviaFilip, I see that you've mentioned internal app. If your domain is a Google Apps for Work/Education domain, you can request to have that registered. This will give you capability to send Gmail schemas internally to users within your domain.
If you need to send to external domains this will not fit your use case. Additionally, if you don't have a Google Apps domain, unfortunately, it looks like you will have to fulfill their guidelines.
I am new to Mandrill and its integration. Can anyone help me to figure out the advantages of using Mandrill? What can be done using Mandrill other than sending messages and tracking them?
Mandrill has many uses. You might have seen those on their website itself. Actually its a Mail Transaporter like PHP mailer, but it uses their own server for sending mails.
As said on their website,
Mandrill runs on a globally distributed infrastructure that can
deliver emails in milliseconds.
This is because when you send a mail through their SMTP or send.json (API) method, the send mail possibly see the fastest path algorithm to deliver a mail. That's why it take milliseconds to deliver. They have ~7 different mail servers worldwide for this.
Major Features,
Sending mails fastly than our own server using PHP Mailer.
Sending mails via pre-designed templates which can be reusable by the merge vars we're using.
Support multiple language platforms like, cURL, JSON, Python, PHP, Ruby, Nodejs, Dart and also their depending frameworks.
It tracks clicks from the mail we sent. For Ex: each and every url link in our sent mails is redirected only after tracking from mandrillapp site. This enables mandrill to track the no of opens in a mail and track analytics.
Through mandrill we can construct our own mail sending application or integrate into an existing application.
It's mostly used for Transactional Messages like functions like welcome mail, forgot password, cart details and etc.
It can be integrated into other shopping cart web applications.
Their api call works on even in the developer environment.
Lesser spam.
Verified domain options like DKIM and SPF settings. This enables the mails to identified by major email providers like gmail, google, etc.
It can be used as SMTP version and can be integrated into major SMTP applications.
Reports: Demographics of email send, Compare status, Which url in our mails has been clicked and no of counts.
Setup rule for delivering emails.
A/B testing, custom SMTP headers, Inbound domains and etc.
There are many other features in developer perspective. If you mention in which platform you're trying to use mandrill addditional details can be provide.
Hope this might help you.
To name a few, You can
1) use templates to do A/B testing ( which allow you to experiment with different templates, and end up with something which is effective).
2) use Embedded images , which will reduce the chance that your emails will end up in spam.
Hope this helps,
Is there any step by step tutorial to send emails using google app engine?
I found one gem https://github.com/maccman/remail
But it is 4 year old gem and not sure whether it will work.
I don't see very much value in this as AppEngine is not very good nor cheap platform to send emails from.
You get 100 free emails per day and all senders need to be Google Apps accounts. If you need more than that then you need a billable app + special requests to increase quota. The price is 1 USD per 10k emails, which is on par with other SMTP providers.
There are a lot of email sending services with direct HTTP APIs and/or Rails gems: Amazon SES, Sendgrid, Postmark, etc..
I am new to mailing with webapps. I looked around and found Sendgrid and Mailchimp. I can see that sendgrid's developer section has a simple smtp url that i should be able to use simply. However i don't find any such thing on Mailchimp. I am wondering how I can use mailchimp to send notifications like User registration or confirmation notification (not necessarily large number of emails blasted altogether but individual notification emails). Right now my application is set to use sendmail in rails.
Can anyone give me clues as to how I can use Mailchimp as the service for sending notification like emails and not mass emails. So far it seems like mailchimp may be more for just mass emails, is that correct?
Thanks
Sendgrid is a simple SMTP provider and relay. Mailchimp is more designed for email marketing using their toolchain. I would reccomend that you stick with sendgrid for simple notification messages but use Mailchimp for email campaigns and complex notifications.
So yes you initial guess is correct that it the two services are to be used for different things. However if you really want to use Mailchimp for email notificatons I would be more than happy to dig up some information for you.