Sha256: d436ac56e3d6419db56bdb026427fa258baa761a3457fc10ce4d8c947de04444

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

module Bently

  class HerokuSendgrid < RailsRecipe

    homepage 'https://devcenter.heroku.com/articles/sendgrid#ruby-rails'

    def initialize
      warn 'heroku commands may incur charges to your account'.upcase
      run 'heroku addons:add sendgrid:starter'
      create './config/initializers/mail.rb', mail_initializer
    end

    protected

    def mail_initializer
%{
ActionMailer::Base.smtp_settings = {
  :address        => 'smtp.sendgrid.net',
  :port           => '587',
  :authentication => :plain,
  :user_name      => ENV['SENDGRID_USERNAME'],
  :password       => ENV['SENDGRID_PASSWORD'],
  :domain         => 'heroku.com'
}
ActionMailer::Base.delivery_method = :smtp
}
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bently-1.0.0 lib/bently/recipe/heroku-sendgrid.rb