ohmysmtp-rails 0.1.9 → 0.2.0

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
  SHA256:
3
- metadata.gz: 7aec72f9093ed5402d98b7d9e78e5948683989416575826e778f195afe99785c
4
- data.tar.gz: 1d116f354b514797f3d3cd4b84fd11e87a9c12e3e8588584f906e5e40058f2e4
3
+ metadata.gz: a597f7e583471f790c1e7b669ad4e9b5f1327675cc176f28016eab512cb0c7dc
4
+ data.tar.gz: 631b23bdb932677707e24ddc4009c708843702d0ec2f44fc9b658c1beaccca2c
5
5
  SHA512:
6
- metadata.gz: 96be43f8135f8feb737988e5a0d495008d5632b7e54dd389aefdec7b77261434941475aec608588c3afbc4f7971779d509681324e449338948af11380591a570
7
- data.tar.gz: 767960c59c5954789e1c95273c4afc013dd73d317e9665a1b8eeb5f4ad12b202058069f060d95cae9fb93d9e8ef832879f1a59cc12fce01de349a6a86aa15a23
6
+ metadata.gz: 908d2acb45d4b64fe17b2091da1b9289dd614f7c6d4f4a61698f17c39fab396a123994932e1281720a993a6a430b73baec18eec654bcfdb639a046f6bf22c63a
7
+ data.tar.gz: 9cf4965645ce0f8d51320d8441516b311a5d833b8257159c1cd19d003a22a993a025056712dc02cb29b088c234ba73022ef86297766ed2e450c0e6cf13e390ad
data/README.md CHANGED
@@ -106,6 +106,10 @@ end
106
106
 
107
107
  Note that this should always be a string, even if using an array of multiple tags.
108
108
 
109
+ ## List-Unsubscribe
110
+
111
+ To add a List-Unsubscribe header: ``
112
+
109
113
  ## Support
110
114
 
111
115
  For support please check the [OhMySMTP Documentation](https://docs.ohmysmtp.com) or contact us at support@ohmysmtp.com
@@ -1,5 +1,5 @@
1
1
  module OhMySMTP
2
2
  module Rails
3
- VERSION = '0.1.9'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ module OhMySMTP
12
12
 
13
13
  def initialize(values)
14
14
  check_api_token(values)
15
- self.settings = {}.merge!(values)
15
+ self.settings = { return_response: true }.merge!(values)
16
16
  end
17
17
 
18
18
  def deliver!(mail)
@@ -24,10 +24,13 @@ module OhMySMTP
24
24
  to: mail.to.join(','),
25
25
  subject: mail.subject,
26
26
  htmlbody: mail.html_part ? mail.html_part.body.decoded : mail.body.to_s,
27
- textbody: mail.multipart? ? (mail.text_part ? mail.text_part.body.decoded : nil) : nil,
27
+ textbody: if mail.multipart?
28
+ mail.text_part ? mail.text_part.body.decoded : nil
29
+ end,
28
30
  cc: mail.cc&.join(','),
29
31
  bcc: mail.bcc&.join(','),
30
32
  replyto: mail.reply_to,
33
+ list_unsubscribe: mail.header['list_unsubscribe'].to_s,
31
34
  attachments: format_attachments(mail.attachments),
32
35
  tags: mail.header['tags'].to_s
33
36
  }.delete_if { |_key, value| value.blank? }.to_json,
@@ -57,7 +60,7 @@ module OhMySMTP
57
60
  end
58
61
 
59
62
  def handle_response(result)
60
- return unless result.code != 200
63
+ return result unless result.code != 200
61
64
 
62
65
  # TODO: Improved error handling
63
66
  res = result.parsed_response
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohmysmtp-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OhMySMTP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-08 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 6.1.3.1
47
+ version: 6.1.4.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 6.1.3.1
54
+ version: 6.1.4.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sqlite3
57
57
  requirement: !ruby/object:Gem::Requirement