sendgrid_actionmailer_adapter 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fc00b2f351543df7b2292bceca96e549c3a03e0
4
- data.tar.gz: a9ae4a0cb08a0442c7fbe92ded4c108f44f53cd1
3
+ metadata.gz: 4d38361de9e37da89fda355531df6a6eeb9b4918
4
+ data.tar.gz: 6484a052301a6f940e0ca129b2a994e2c30fb2a4
5
5
  SHA512:
6
- metadata.gz: b63e0b130b073189f16856705932d12116ca4d59c80c280d127f8a27ebad53826269ed9bbc9fd5bdcca7c20454739805464b6bd4420c3d0d9cf05dabe7fee278
7
- data.tar.gz: 1ef8d805710cd759e8df2437a5e2ba5e336141a79c47fb69f2bd0b06d51fda99bdbf1cfdc7bc161afcbfca23f9795d4125a562a27fd4ac6881172d3e3a0e7c4a
6
+ metadata.gz: f5fbe19d6d53ffb020a1d5fb9cfe464368aebf17ba062de71752022b0d0dc601d3f96a0a969b4ff57b726417da9368e68fa11473d2ab1f1f527aac28aa170b84
7
+ data.tar.gz: a940aeb57e9755646c88463f2647efefdfcb5cf7e98f3d052730233be54a0aa966439d72c6bc641199d4963da16e10e8cdbba571fc36798989de21c5b083b41a
@@ -7,7 +7,7 @@ module SendGridActionMailerAdapter
7
7
 
8
8
  class << self
9
9
  attr_accessor :api_key, :host, :request_headers, :version, :retry_max_count,
10
- :retry_wait_seconds
10
+ :retry_wait_seconds, :return_response
11
11
 
12
12
  # Set your configuration with block.
13
13
  def configure
@@ -23,12 +23,13 @@ module SendGridActionMailerAdapter
23
23
  api_key: api_key || '',
24
24
  host: host,
25
25
  request_headers: request_headers,
26
- version: version
26
+ version: version,
27
27
  },
28
28
  retry: {
29
29
  max_count: retry_max_count || DEFAULT_RETRY_MAX_COUNT,
30
- wait_seconds: retry_wait_seconds || DEFAULT_RETRY_WAIT_SECONDS
31
- }
30
+ wait_seconds: retry_wait_seconds || DEFAULT_RETRY_WAIT_SECONDS,
31
+ },
32
+ return_response: return_response,
32
33
  }.freeze
33
34
  end
34
35
 
@@ -40,6 +41,7 @@ module SendGridActionMailerAdapter
40
41
  self.version = nil
41
42
  self.retry_max_count = nil
42
43
  self.retry_wait_seconds = nil
44
+ self.return_response = nil
43
45
  @settings = nil
44
46
  end
45
47
  end
@@ -10,7 +10,7 @@ module SendGridActionMailerAdapter
10
10
  VALIDATORS = [
11
11
  ->(mail) { "'from' is required." if mail.from_addrs.empty? },
12
12
  ->(mail) { "'to_addrs' must not be empty." if mail.to_addrs.empty? },
13
- ->(mail) { "'subject' is required." if mail.subject.nil? || mail.subject.empty? }
13
+ ->(mail) { "'subject' is required." if mail.subject.nil? || mail.subject.empty? },
14
14
  ].freeze
15
15
 
16
16
  CONVERTERS = {
@@ -41,7 +41,7 @@ module SendGridActionMailerAdapter
41
41
  mail.attachments.map do |attachment|
42
42
  ::SendGrid::Attachment.new.tap do |sendgrid_attachment|
43
43
  sendgrid_attachment.type = attachment.mime_type
44
- sendgrid_attachment.content = ::Base64.encode64(attachment.body.raw_source)
44
+ sendgrid_attachment.content = ::Base64.strict_encode64(attachment.body.raw_source)
45
45
  sendgrid_attachment.filename = ::Mail::Encodings.decode_encode(
46
46
  attachment.content_type_parameters['filename'], :decode
47
47
  )
@@ -59,7 +59,7 @@ module SendGridActionMailerAdapter
59
59
  reply_to: ->(mail) {
60
60
  addr = mail[:reply_to]&.addrs&.first
61
61
  ::SendGrid::Email.new(email: addr.address, name: addr.display_name) if addr
62
- }
62
+ },
63
63
  }.freeze
64
64
 
65
65
  class << self
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SendGridActionMailerAdapter
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid_actionmailer_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryu39
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-28 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sendgrid-ruby
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: actionmailer
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: A ActionMailer adapter using SendGrid Web API v3.
112
126
  email:
113
127
  - dev.ryu39@gmail.com