S

Mails

Sander Schepens(Sannie)

Hi Nick.

First off. Thanks for writing the book. I had my doubts considering the price, but having bought it, I can say it's worth it. Came exactly at the right time for the experience and level of learning I've had with Rails.

One thing I don't quite get is the section wrt mails. I am also reading the Rails 5 way of Obie Fernandez and there is a whole chapter on action mailer. On page 68 of your book you state that it's better to use a third party service for mails. I've taken a look at sendgrid, but basically they seem to recommend that you set up domain authentication for your domain. I thought the whole point was that sendgrid was a more known and reliable entity for gmail and the likes, so that your mail has less of chance to end in spam. They also seem to promote the use of their own email design functionality and in their API you can reference those templates together with some json of the specifics that need to be substituted in the template (email, name and the likes). In your book you seem to hint that the whole design can/should be done in rails, but I haven't been able to find how you would send the mails you design with rails via sendgrid.

Maybe I'm missing something? I definitely had a much easier time deciphering mailchimps API :), but maybe that also has to do with me being unfamiliar with the basics of how mail works. Thanks and good luck with the book and other endeavors!

  • Nick Haskins replied

    Hey Sander!

    Glad to hear that you're enjoying the book!

    The line between functionality between what your app should be doing and what a transactional email provider like SendGrid should be doing is blurry.

    The domain authentication is really just to bolster the "who sent this email" question. So for the email client instead of just seeing sendgrid and possibly marking as SPAM, it shows that it comes from your email which is a bit more authentic.

    For email templates, yeah that's a tough choice to make.

    I've always like to stay "Railsy" with our email templates, mostly because they typically have dynamic data like the users name (in simple cases) or things like game points awarded, or the course being completed. In these cases it's helpful to reference the course, or the thing that awarded the game point.

    There are less things to worry about if you're using Sendgrid templates, like styling and such, but with gems like Inky-RB you can write in "HTML like" syntax, and you can use CSS classes that spit out inline styles.

    Anyway, let me know if this answers your question!

  • S
    Sander Schepens(Sannie) replied

    Hi Nick

    Thanks for your reply! Yes that answers my question mostly. I guess I was also struggling a bit with the information overload on sendgrids website and their API documentation. I looked at some of their competitors, e.g. mandrill (part of mailchimp) and postmark. Much clearer docs for me. Helped me understand a bit better what I get from it and how to set it up. Thanks for the help!