Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Mark Lavelle
Mark Lavelle
2,910 Points

Mailer Addons from Heroku - deploying the Treebook app to Heroku,

My treebook application's user_friendships is working locally, state machine set up correctly and mailer is set to localhost as per video instruction and Jason mentions changing to your host-server but with heroku you have to add on a mailer, Mailchimp for example, Any tips on how to do this? not married to Mailchimp but it has a cool UI so was leaning there..

3 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Mark Lavelle check out their MailGun addon -- that's more what you're looking for. They have a free version that is pretty easy to set up.

Todd Nestor
Todd Nestor
10,689 Points

If you want to use Mandrill then just add this to you config/environment.rb file, at the bottom is fine, that is how I did it for www.myworldtogo.com:

ActionMailer::Base.smtp_settings = {
    :port =>           '587',
    :address =>        'smtp.mandrillapp.com',
    :user_name =>      ENV['MANDRILL_USERNAME'],
    :password =>       ENV['MANDRILL_APIKEY'],
    :domain =>         'heroku.com',
    :authentication => :plain
}
ActionMailer::Base.delivery_method = :smtp

Hope this helps.

Todd Nestor
Todd Nestor
10,689 Points

Better yet, if you take that code I posted above, or here it is again:

ActionMailer::Base.smtp_settings = {
    :port =>           '587',
    :address =>        'smtp.mandrillapp.com',
    :user_name =>      ENV['MANDRILL_USERNAME'],
    :password =>       ENV['MANDRILL_APIKEY'],
    :domain =>         'heroku.com',
    :authentication => :plain
}
ActionMailer::Base.delivery_method = :smtp

and put it in config/environments/production.rb before the final "end" then it won't give you any errors in your test / development environments.