aws-ses-mailer 0.0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: af69037cb1258f34acd646cf2c32cb10acace365f424dd884e800624a83fbc63
4
+ data.tar.gz: e65f6c8c18c84ca4db0b1492c614ef985ddbfe0e450da2a20b09cbf4c55fa0ee
5
+ SHA512:
6
+ metadata.gz: 1561acca5cdd59f0e36030c479cc32d097b3fa1b476e2540aad8e04c2fcb812c7fafe681d2d6065424022f7607c5e4c59bf8e8226a1329747141dadef5178641
7
+ data.tar.gz: 55e5247b94b1f6e85c61316f4f8b7b5cd3e03fe6379f14b57be907e80d43137fc63c0b5f06377a6990e9ef43a1c9264c5f38cea5cc22e6a1032880d4b714afd3
@@ -0,0 +1,20 @@
1
+ Copyright 2019 tabakazu
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,23 @@
1
+ # Aws::Ses::Mailer
2
+ AWS SES Client for Action Mailer
3
+
4
+ ## Rails Setup
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'aws-ses-mailer'
9
+ ```
10
+
11
+ Set the delivery method to config/environments/*.rb:
12
+
13
+ ```ruby
14
+ config.action_mailer.delivery_method = :aws_ses_mailer
15
+ ```
16
+
17
+ Set the add options for aws setting to config/initializers/*.rb:
18
+
19
+ ```ruby
20
+ Aws::Ses::Mailer.add_options({
21
+ region: 'us-west-2'
22
+ })
23
+ ```
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Aws::Ses::Mailer'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ require 'bundler/gem_tasks'
@@ -0,0 +1,21 @@
1
+ module Aws
2
+ module Ses
3
+ module Mailer
4
+ autoload :DeliveryMethod, 'aws/ses/mailer/delivery_method'
5
+
6
+ class << self
7
+ def add_options(options = { region: 'us-west-2' })
8
+ ActiveSupport.on_load :action_mailer do
9
+ ActionMailer::Base.add_delivery_method(
10
+ :aws_ses_mailer,
11
+ Aws::Ses::Mailer::DeliveryMethod,
12
+ options
13
+ )
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ require 'aws/ses/mailer/railtie' if defined? Rails::Railtie
@@ -0,0 +1,27 @@
1
+ require 'aws-sdk-ses'
2
+
3
+ module Aws
4
+ module Ses
5
+ module Mailer
6
+ class DeliveryMethod
7
+ attr_accessor :settings
8
+
9
+ def initialize(options = {})
10
+ self.settings = options
11
+ self.ses = Aws::SES::Client.new(settings)
12
+ end
13
+
14
+ def deliver!(mail)
15
+ options = { raw_message: {} }
16
+ options[:destinations] = mail.destinations
17
+ options[:raw_message][:data] = mail.to_s
18
+
19
+ ses.send_raw_email(options)
20
+ end
21
+
22
+ private
23
+ attr_accessor :ses
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,11 @@
1
+ module Aws
2
+ module Ses
3
+ module Mailer
4
+ class Railtie < ::Rails::Railtie
5
+ initializer 'aws-ses-mailer.add_delivery_method', before: :load_config_initializers do
6
+ Aws::Ses::Mailer.add_options
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ module Aws
2
+ module Ses
3
+ module Mailer
4
+ VERSION = '0.0.3.2'
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-ses-mailer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3.2
5
+ platform: ruby
6
+ authors:
7
+ - Kazuma Taba
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-08-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-ses
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 5.2.3
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 5.2.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.7'
55
+ description: AWS SES Client for Action Mailer
56
+ email:
57
+ - tkazz.bd1@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - MIT-LICENSE
63
+ - README.md
64
+ - Rakefile
65
+ - lib/aws/ses/mailer.rb
66
+ - lib/aws/ses/mailer/delivery_method.rb
67
+ - lib/aws/ses/mailer/railtie.rb
68
+ - lib/aws/ses/mailer/version.rb
69
+ homepage: https://github.com/tabakazu/aws-ses-mailer
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubygems_version: 3.0.3
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: AWS SES Client for Action Mailer
92
+ test_files: []