Skip to content

Commit

Permalink
use sendgrid to send emails
Browse files Browse the repository at this point in the history
  • Loading branch information
dwradcliffe committed Oct 3, 2016
1 parent a7a6ece commit 21502ff
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion config/environments/production.rb
Expand Up @@ -63,7 +63,6 @@
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.delivery_method = :sendmail
config.action_mailer.default_url_options = { host: Gemcutter::HOST,
protocol: Gemcutter::PROTOCOL }

Expand Down
1 change: 0 additions & 1 deletion config/environments/staging.rb
Expand Up @@ -63,7 +63,6 @@
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.delivery_method = :sendmail
config.action_mailer.default_url_options = { host: Gemcutter::HOST,
protocol: Gemcutter::PROTOCOL }

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/clearance.rb
@@ -1,6 +1,6 @@
Clearance.configure do |config|
config.allow_sign_up = (ENV['DISABLE_SIGNUP'].to_s == 'true') ? false : true
config.mailer_sender = "help@rubygems.org"
config.mailer_sender = "RubyGems.org <no-reply@mailer.rubygems.org>"
config.secure_cookie = true unless Rails.env.test? || Rails.env.development?
config.password_strategy = Clearance::PasswordStrategies::BCryptMigrationFromSHA1
end
12 changes: 12 additions & 0 deletions config/initializers/sendgrid.rb
@@ -0,0 +1,12 @@
if Rails.env.production? || Rails.env.staging?
ActionMailer::Base.smtp_settings = {
address: 'smtp.sendgrid.net',
port: 587,
user_name: ENV['SENDGRID_USERNAME'],
password: ENV['SENDGRID_PASSWORD'],
domain: 'mailer.rubygems.org',
authentication: :plain,
enable_starttls_auto: true
}
ActionMailer::Base.delivery_method = :smtp
end

0 comments on commit 21502ff

Please sign in to comment.