From a82a3f96daeca6f3037c350c8887e449923d0521 Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Thu, 3 Apr 2025 10:11:37 -0700 Subject: [PATCH 1/3] update gems --- Gemfile.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7feca1338..907c8a21c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -103,7 +103,7 @@ GEM aes_key_wrap (1.1.0) ast (2.4.3) aws-eventstream (1.3.2) - aws-partitions (1.1078.0) + aws-partitions (1.1080.0) aws-record (2.13.2) aws-sdk-dynamodb (~> 1, >= 1.85.0) aws-sdk-core (3.222.1) @@ -176,7 +176,7 @@ GEM brakeman (7.0.0) racc builder (3.3.0) - bullet (8.0.1) + bullet (8.0.2) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) bundler-audit (0.9.2) @@ -287,7 +287,7 @@ GEM activesupport (>= 6.0.0) railties (>= 6.0.0) io-console (0.8.0) - irb (1.15.1) + irb (1.15.2) pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) @@ -346,7 +346,7 @@ GEM mime-types (3.6.2) logger mime-types-data (~> 3.2015) - mime-types-data (3.2025.0325) + mime-types-data (3.2025.0402) mini_magick (5.2.0) benchmark logger @@ -368,7 +368,7 @@ GEM timeout net-smtp (0.5.1) net-protocol - newrelic_rpm (9.17.0) + newrelic_rpm (9.18.0) nio4r (2.7.4) nokogiri (1.18.7) mini_portile2 (~> 2.8.2) @@ -529,7 +529,7 @@ GEM rspec-support (3.13.2) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.75.1) + rubocop (1.75.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -537,10 +537,10 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.43.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.43.0) + rubocop-ast (1.44.0) parser (>= 3.3.7.2) prism (~> 1.4) rubocop-rails (2.31.0) @@ -574,7 +574,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sidekiq (8.0.1) + sidekiq (8.0.2) connection_pool (>= 2.5.0) json (>= 2.9.0) logger (>= 1.6.2) From df64c09e420b40620c91db06cf398eed8ad74c0e Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Thu, 3 Apr 2025 10:12:30 -0700 Subject: [PATCH 2/3] update aws-sdk-rails --- Gemfile.lock | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 907c8a21c..e6c431ee4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,8 +104,6 @@ GEM ast (2.4.3) aws-eventstream (1.3.2) aws-partitions (1.1080.0) - aws-record (2.13.2) - aws-sdk-dynamodb (~> 1, >= 1.85.0) aws-sdk-core (3.222.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -113,43 +111,16 @@ GEM base64 jmespath (~> 1, >= 1.6.1) logger - aws-sdk-dynamodb (1.129.0) - aws-sdk-core (~> 3, >= 3.210.0) - aws-sigv4 (~> 1.5) aws-sdk-kms (1.99.0) aws-sdk-core (~> 3, >= 3.216.0) aws-sigv4 (~> 1.5) - aws-sdk-rails (4.1.0) - actionmailbox (>= 7.0.0) - aws-record (~> 2) - aws-sdk-s3 (~> 1, >= 1.123.0) - aws-sdk-ses (~> 1, >= 1.50.0) - aws-sdk-sesv2 (~> 1, >= 1.34.0) - aws-sdk-sns (~> 1, >= 1.61.0) - aws-sdk-sqs (~> 1, >= 1.56.0) - aws-sessionstore-dynamodb (~> 2) - concurrent-ruby (~> 1.3, >= 1.3.1) - railties (>= 7.0.0) + aws-sdk-rails (5.1.0) + aws-sdk-core (~> 3) + railties (>= 7.1.0) aws-sdk-s3 (1.183.0) aws-sdk-core (~> 3, >= 3.216.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sdk-ses (1.76.0) - aws-sdk-core (~> 3, >= 3.210.0) - aws-sigv4 (~> 1.5) - aws-sdk-sesv2 (1.66.0) - aws-sdk-core (~> 3, >= 3.210.0) - aws-sigv4 (~> 1.5) - aws-sdk-sns (1.90.0) - aws-sdk-core (~> 3, >= 3.210.0) - aws-sigv4 (~> 1.5) - aws-sdk-sqs (1.88.0) - aws-sdk-core (~> 3, >= 3.210.0) - aws-sigv4 (~> 1.5) - aws-sessionstore-dynamodb (2.2.0) - aws-sdk-dynamodb (~> 1, >= 1.85.0) - rack (>= 2, < 4) - rack-session (>= 1, < 3) aws-sigv4 (1.11.0) aws-eventstream (~> 1, >= 1.0.2) axe-core-api (4.10.2) From f011ffc8acc5787eee91393da97f69a402c04a79 Mon Sep 17 00:00:00 2001 From: Ryan Wold Date: Thu, 3 Apr 2025 10:29:32 -0700 Subject: [PATCH 3/3] add aws-actionmailer-ses --- Gemfile | 1 + Gemfile.lock | 11 +++++++++++ config/environments/production.rb | 8 +++++++- config/environments/staging.rb | 7 ++++++- config/initializers/amazon_ses.rb | 6 ------ 5 files changed, 25 insertions(+), 8 deletions(-) delete mode 100644 config/initializers/amazon_ses.rb diff --git a/Gemfile b/Gemfile index c782fe9a6..a4c83f2c8 100644 --- a/Gemfile +++ b/Gemfile @@ -44,6 +44,7 @@ gem "image_processing", "~> 1.12" gem 'active_model_serializers' gem 'acts-as-list' +gem 'aws-actionmailer-ses' gem 'aws-sdk-rails', '>= 3.8.0' gem 'aws-sdk-s3' gem 'carrierwave', '>= 2.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index e6c431ee4..8c4814611 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -102,6 +102,10 @@ GEM public_suffix (>= 2.0.2, < 7.0) aes_key_wrap (1.1.0) ast (2.4.3) + aws-actionmailer-ses (1.0.0) + actionmailer (>= 7.1.0) + aws-sdk-ses (~> 1, >= 1.50.0) + aws-sdk-sesv2 (~> 1, >= 1.34.0) aws-eventstream (1.3.2) aws-partitions (1.1080.0) aws-sdk-core (3.222.1) @@ -121,6 +125,12 @@ GEM aws-sdk-core (~> 3, >= 3.216.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) + aws-sdk-ses (1.82.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sdk-sesv2 (1.73.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) aws-sigv4 (1.11.0) aws-eventstream (~> 1, >= 1.0.2) axe-core-api (4.10.2) @@ -629,6 +639,7 @@ DEPENDENCIES active_model_serializers acts-as-list acts-as-taggable-on + aws-actionmailer-ses aws-sdk-rails (>= 3.8.0) aws-sdk-s3 axe-core-rspec diff --git a/config/environments/production.rb b/config/environments/production.rb index 7878928ea..8b016ba7f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -99,7 +99,13 @@ # Reference: https://github.com/ankane/secure_rails config.action_controller.asset_host = ENV.fetch('TOUCHPOINTS_WEB_DOMAIN') - config.action_mailer.delivery_method = :ses + config.action_mailer.delivery_method = :ses_v2 + config.action_mailer.ses_v2_settings = { + region: ENV.fetch("AWS_SES_REGION"), + access_key_id: ENV.fetch("AWS_SES_ACCESS_KEY_ID", nil), + secret_access_key: ENV.fetch("AWS_SES_SECRET_ACCESS_KEY", nil) + } + config.action_mailer.perform_deliveries = true config.active_record.encryption.primary_key = ENV.fetch("RAILS_ACTIVE_RECORD_PRIMARY_KEY") diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 1c1ca0422..f1b5694e3 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -109,7 +109,12 @@ # Reference: https://github.com/ankane/secure_rails config.action_controller.asset_host = ENV.fetch('TOUCHPOINTS_WEB_DOMAIN') - config.action_mailer.delivery_method = :ses + config.action_mailer.delivery_method = :ses_v2 + config.action_mailer.ses_v2_settings = { + region: ENV.fetch("AWS_SES_REGION"), + access_key_id: ENV.fetch("AWS_SES_ACCESS_KEY_ID", nil), + secret_access_key: ENV.fetch("AWS_SES_SECRET_ACCESS_KEY", nil) + } config.action_mailer.perform_deliveries = true config.active_record.encryption.primary_key = ENV.fetch("RAILS_ACTIVE_RECORD_PRIMARY_KEY") diff --git a/config/initializers/amazon_ses.rb b/config/initializers/amazon_ses.rb deleted file mode 100644 index c8eff3f27..000000000 --- a/config/initializers/amazon_ses.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -Aws::Rails.add_action_mailer_delivery_method(:ses, - access_key_id: ENV.fetch('AWS_SES_ACCESS_KEY_ID', nil), - secret_access_key: ENV.fetch('AWS_SES_SECRET_ACCESS_KEY', nil), - region: ENV.fetch('AWS_SES_REGION', nil))