aws-actionmailer-ses 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fb4818425a87e651216f3e78bc6ce39ba3dd6c9974efff08c31c33ce81c4ab9
4
- data.tar.gz: d4fedf6f6c76fa75753f8c57092909da068672f778dcf910c123c0b52c19d910
3
+ metadata.gz: d5155bf8bc7c5caf160e77e7768a0029fe7514e7d33d9ab14544072e64bb96cf
4
+ data.tar.gz: a281ec02f365a903eade4ef008fde838b5748100211b3e2fa37aac1909d9dcff
5
5
  SHA512:
6
- metadata.gz: 436e8d83f48c8dad3457c642907af4094c961f764781a17907b6b69f0972255218b34e55d220afbc8b9844127af5bac74fa50254f79503a762a587f73b2e45cb
7
- data.tar.gz: 7dd3b1eadad71f9e9241229c4e5d329e91d558868e1e48472d9a4ac2c09d8056b58e8c7a7d7ec6ee5c7e16cc81c94de6f8bfc8ab3d44a0ff152edf0e4aa670f6
6
+ metadata.gz: c865beacd6615da65f966d7e89cf145bf301d72babec69915c7a1e74c277048d2005c86634857156f71088a37898623c8349a90f5cddd77ce20c1a38735f9ae3
7
+ data.tar.gz: 2d4ebed009cc45470df4b4ab9c2258dbc8737ec00b885c34abc7b0f570165cb26f01b597c737e4cef5b206563442333f1bc02c2fac4725b78a8a7a23648e68ab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.0.0 (2024-11-21)
2
+ ------------------
3
+
4
+ * Feature - [Major Version] Register ActionMailers with a Railtie and allow for configuration using `config.action_mailer.ses_v2_settings` and `config.action_mailer.ses_settings`.
5
+
1
6
  0.1.0 (2024-11-16)
2
7
  ------------------
3
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 1.0.0
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module ActionMailer
5
+ # @api private
6
+ class Railtie < Rails::Railtie
7
+ ActiveSupport.on_load(:action_mailer) do
8
+ add_delivery_method :ses, SES::Mailer
9
+ add_delivery_method :ses_v2, SESV2::Mailer
10
+ end
11
+ end
12
+ end
13
+ end
@@ -7,22 +7,21 @@ module Aws
7
7
  module SES
8
8
  # Provides a delivery method for ActionMailer that uses Amazon Simple Email Service.
9
9
  #
10
- # Configure a delivery method with:
11
- #
12
- # client_options = { region: 'us-west-2' }
13
- # ActionMailer::Base.add_delivery_method :ses, Aws::ActionMailer::SESMailer, **client_options
14
- #
15
- # Client options are used to construct a new Aws::SES::Client instance.
10
+ # Delivery settings are used to construct a new Aws::SES::Client instance.
16
11
  # Once you have a delivery method, you can configure your Rails environment to use it:
17
12
  #
18
13
  # config.action_mailer.delivery_method = :ses
14
+ # config.action_mailer.ses_settings = { region: 'us-west-2' }
19
15
  #
20
16
  # @see https://guides.rubyonrails.org/action_mailer_basics.html
21
17
  class Mailer
22
- # @param [Hash] options Passes along initialization options to
18
+ attr_reader :settings
19
+
20
+ # @param [Hash] settings Passes along initialization options to
23
21
  # [Aws::SES::Client.new](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SES/Client.html#initialize-instance_method).
24
- def initialize(options = {})
25
- @client = Aws::SES::Client.new(options)
22
+ def initialize(settings = {})
23
+ @settings = settings
24
+ @client = Aws::SES::Client.new(settings)
26
25
  @client.config.user_agent_frameworks << 'aws-actionmailer-ses'
27
26
  end
28
27
 
@@ -37,11 +36,6 @@ module Aws
37
36
  message.header[:ses_message_id] = response.message_id
38
37
  end
39
38
  end
40
-
41
- # @return [Hash]
42
- def settings
43
- {}
44
- end
45
39
  end
46
40
  end
47
41
  end
@@ -7,22 +7,21 @@ module Aws
7
7
  module SESV2
8
8
  # Provides a delivery method for ActionMailer that uses Amazon Simple Email Service V2.
9
9
  #
10
- # Configure a delivery method with:
11
- #
12
- # client_options = { region: 'us-west-2' }
13
- # ActionMailer::Base.add_delivery_method :ses_v2, Aws::ActionMailer::SESV2Mailer, **client_options
14
- #
15
- # Client options are used to construct a new Aws::SESV2::Client instance.
10
+ # Delivery settings are used to construct a new Aws::SESV2::Client instance.
16
11
  # Once you have a delivery method, you can configure your Rails environment to use it:
17
12
  #
18
13
  # config.action_mailer.delivery_method = :ses_v2
14
+ # config.action_mailer.ses_v2_settings = { region: 'us-west-2' }
19
15
  #
20
16
  # @see https://guides.rubyonrails.org/action_mailer_basics.html
21
17
  class Mailer
22
- # @param [Hash] options Passes along initialization options to
18
+ attr_reader :settings
19
+
20
+ # @param [Hash] settings Passes along initialization settings to
23
21
  # [Aws::SESV2::Client.new](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SESV2/Client.html#initialize-instance_method).
24
- def initialize(options = {})
25
- @client = Aws::SESV2::Client.new(options)
22
+ def initialize(settings = {})
23
+ @settings = settings
24
+ @client = Aws::SESV2::Client.new(settings)
26
25
  @client.config.user_agent_frameworks << 'aws-actionmailer-ses'
27
26
  end
28
27
 
@@ -41,11 +40,6 @@ module Aws
41
40
  end
42
41
  end
43
42
 
44
- # @return [Hash]
45
- def settings
46
- {}
47
- end
48
-
49
43
  private
50
44
 
51
45
  # smtp_envelope_from will default to the From address *without* sender names.
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative 'aws/action_mailer/ses/mailer'
4
4
  require_relative 'aws/action_mailer/ses_v2/mailer'
5
+ require_relative 'aws/action_mailer/railtie' if defined?(Rails::Railtie)
5
6
 
6
7
  module Aws
7
8
  module ActionMailer
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-actionmailer-ses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-16 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-ses
@@ -75,6 +75,7 @@ files:
75
75
  - LICENSE
76
76
  - VERSION
77
77
  - lib/aws-actionmailer-ses.rb
78
+ - lib/aws/action_mailer/railtie.rb
78
79
  - lib/aws/action_mailer/ses/mailer.rb
79
80
  - lib/aws/action_mailer/ses_v2/mailer.rb
80
81
  homepage: https://github.com/aws/aws-actionmailer-ses-ruby