Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up Receiving a reply in production!! #12

Open
eriol12 opened this issue Dec 12, 2014 · 1 comment
Open

How to set up Receiving a reply in production!! #12

eriol12 opened this issue Dec 12, 2014 · 1 comment

Comments

@eriol12
Copy link

eriol12 commented Dec 12, 2014

The way I see it, there is many components to this.
First as the author(s) mention in the book gmail is not a solid solution so some modifications are in order big time! Let's choose sendgrid. In the config/environments/production.rb let's add the proper settings:

config.action_mailer.delivery_method = :smtp
  host = '<your_heroku_app_name>.herokuapp.com'
  config.action_mailer.default_url_options = { host: host }
  ActionMailer::Base.smtp_settings = {
    :address        => 'smtp.sendgrid.net',
    :port           => '587',
    :authentication => :plain,
    :user_name      => ENV['SENDGRID_USERNAME'],
    :password       => ENV['SENDGRID_PASSWORD'],
    :domain         => 'heroku.com',
    :enable_starttls_auto => true
  }

Now let us say we use GoDaddy for the domain name my_domain_name.com, and we have setup email forwarding with catch all setting in place since when user replies to a comment (e.g. in the Notifier class reply_to: "Ticketee App <info+" +"#{@project.id}+#{@ticket.id}@my_domain_name.com>) that email address will not be existent! So according to my "calculations" all variants of the email info@my_domain_name.com will be forwarded to info@my_domain_name.com!

Now the issue is how is the class Receiver.parse(email) method going access the list of to addresses for the info@my_domain_name.com email, and get the first of them?!!!!!!!

Note: The text below is pure speculation on my part, since I have no clue how to make sense of it just like when Matthew McConaughey was chilling inside the blackhole in Interstellar!

So now we ought to actually have an email plan setup in GoDaddy to access the info@my_domain_name.com! And after somehow we setup username & password for info@my_domain_name.com somewhere in ticketee rails app and have Receiver class get the email feed, differentiate from multiple emails (God knows how!) and select the one needed to create the comment pertaining to ticket. And another thing i cannot understand! How does Receiver class handle emails when you can have multiple replies at exactly the same time from multiple users!

Therefore the authors need to further elaborate since this is a major and important part of understanding this edition of Rails 4 in Action!! Please author(s) shed light on this topic...

@radar
Copy link
Contributor

radar commented Feb 28, 2015

We've actually removed this section from Rails 4 in Action as setting up a way to receive emails seemed to difficult to explain in the book. However, on investigation this morning it might be possible using the Mailgun code that we have already, as described here: https://devcenter.heroku.com/articles/mailgun.

This'll probably be supplementary material released after the book is done, rather than mentioned in the book itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants