Skip to content

Commit

Permalink
Change mailgun to aws ses
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAvlonitis committed Nov 4, 2024
1 parent e7b44e2 commit 1cc684d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ AWS_ACCESS_KEY_ID=fakeid
AWS_SECRET_ACCESS_KEY=fakekey
AWS_REGION=fakeregion
SECRET_KEY_BASE=fakekey
MAILGUN_API_KEY=fakekey
SES_USERNAME=fakeusername
SES_PASSWORD=fakepassword
SES_URL=fakeurl
EMAIL_DOMAIN=
FRONTEND_URL=
RECAPTCHA_SECRET_KEY=fakekey
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ gem 'rails'
gem 'active_model_serializers'
gem 'active_storage_validations'
gem 'acts_as_votable'
gem "aws-sdk-s3", require: false
gem "aws-sdk-s3", require: false
gem "aws-sdk-ses", require: false
gem 'devise'
gem 'doorkeeper', '~> 5.4'
gem 'kaminari'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ GEM
aws-sdk-core (~> 3, >= 3.201.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sdk-ses (1.69.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.9.1)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
Expand Down Expand Up @@ -439,6 +442,7 @@ DEPENDENCIES
active_storage_validations
acts_as_votable
aws-sdk-s3
aws-sdk-ses
climate_control
database_cleaner
devise
Expand Down
16 changes: 10 additions & 6 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { host: 'kardies.gr' }

# MAILGUN settings
config.action_mailer.delivery_method = :mailgun

config.action_mailer.mailgun_settings = {
api_key: ENV['MAILGUN_API_KEY'],
domain: ENV['EMAIL_DOMAIN']
# AWS SES settings
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: ENV['SES_URL'],
port: 587,
user_name: ENV['SES_USERNAME'],
password: ENV['SES_PASSWORD'],
authentication: :login,
enable_starttls_auto: true
}

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
Expand Down

0 comments on commit 1cc684d

Please sign in to comment.