Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.