ohmysmtp-rails 0.1.4 → 0.1.9

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: 07e19ef5d89ef5ec07f9893441bc2256c4a1122144b0e69f142a983ec6195b1a
4
- data.tar.gz: 52a7d5c448d85576bc5a52210594724d1ebbe630ec3ad21ebef6198147f23f05
3
+ metadata.gz: 7aec72f9093ed5402d98b7d9e78e5948683989416575826e778f195afe99785c
4
+ data.tar.gz: 1d116f354b514797f3d3cd4b84fd11e87a9c12e3e8588584f906e5e40058f2e4
5
5
  SHA512:
6
- metadata.gz: 493ce4214f2d21f117f08dc7327cacaaa8832c0ce864cfd2ad1bea1c23cbb11eada0941c69c3a99129a85b7edbfefd5f6f65e92cc475a1dc858e08d48728feea
7
- data.tar.gz: 7a8ff100eb661c50efaf2010c4299ad8b646bfa0f40429219e8116538cdb5b4e8a47108c7543bd7d196bd957112c67a49efdc66356e102a95eaf24a65b08b550
6
+ metadata.gz: 96be43f8135f8feb737988e5a0d495008d5632b7e54dd389aefdec7b77261434941475aec608588c3afbc4f7971779d509681324e449338948af11380591a570
7
+ data.tar.gz: 767960c59c5954789e1c95273c4afc013dd73d317e9665a1b8eeb5f4ad12b202058069f060d95cae9fb93d9e8ef832879f1a59cc12fce01de349a6a86aa15a23
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
4
4
  [![Gem Version](https://badge.fury.io/rb/ohmysmtp-rails.svg)](https://badge.fury.io/rb/ohmysmtp-rails)
5
-
5
+ [![OhMySMTP Rails](https://circleci.com/gh/ohmysmtp/ohmysmtp-rails.svg?style=svg)](https://app.circleci.com/pipelines/github/ohmysmtp/ohmysmtp-rails)
6
6
 
7
7
  [OhMySMTP](https://ohmysmtp.com) lets you send transactional emails from your app over an easy to use API.
8
8
 
@@ -81,12 +81,41 @@ config.action_mailer.delivery_method = :ohmysmtp
81
81
  config.action_mailer.ohmysmtp_settings = { :api_token => Rails.application.secrets.ohmysmtp_api_token }
82
82
  ```
83
83
 
84
+ ## Tagging
85
+
86
+ You can tag messages and filter them later in the OhMySMTP UI. To do this, pass the tags as a header by adding a tag variable to your `mail` method call.
87
+
88
+ ```ruby
89
+ class TestMailer < ApplicationMailer
90
+ default from: 'notifications@example.com',
91
+ to: 'fake@sdfasdfsdaf.com'
92
+
93
+ def single_tag
94
+ mail(
95
+ tags: 'test tag' # One tag
96
+ )
97
+ end
98
+
99
+ def multi_tag
100
+ mail(
101
+ tags: "['test tag', 'another-tag']" # Multiple tags
102
+ )
103
+ end
104
+ end
105
+ ```
106
+
107
+ Note that this should always be a string, even if using an array of multiple tags.
108
+
84
109
  ## Support
85
110
 
86
111
  For support please check the [OhMySMTP Documentation](https://docs.ohmysmtp.com) or contact us at support@ohmysmtp.com
87
112
 
88
113
  ## Contributing
89
114
 
115
+ Please ensure to add a test for any change you make. To run the tests:
116
+
117
+ `bin/test`
118
+
90
119
  Pull requests always welcome
91
120
 
92
121
  ## License
@@ -20,7 +20,7 @@ module OhMySMTP
20
20
  result = HTTParty.post(
21
21
  'https://app.ohmysmtp.com/api/v1/send',
22
22
  body: {
23
- from: mail.from.join(','),
23
+ from: mail.header[:from]&.address_list&.addresses&.first.to_s,
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,
@@ -28,8 +28,9 @@ module OhMySMTP
28
28
  cc: mail.cc&.join(','),
29
29
  bcc: mail.bcc&.join(','),
30
30
  replyto: mail.reply_to,
31
- attachments: format_attachments(mail.attachments)
32
- }.compact.to_json,
31
+ attachments: format_attachments(mail.attachments),
32
+ tags: mail.header['tags'].to_s
33
+ }.delete_if { |_key, value| value.blank? }.to_json,
33
34
  headers: {
34
35
  'User-Agent' => "OhMySMTP Rails Gem v#{OhMySMTP::Rails::VERSION}",
35
36
  'Accept' => 'application/json',
@@ -1,5 +1,5 @@
1
1
  module OhMySMTP
2
2
  module Rails
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.9'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohmysmtp-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - OhMySMTP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-18 00:00:00.000000000 Z
11
+ date: 2021-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: actionmailer
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -53,47 +39,33 @@ dependencies:
53
39
  - !ruby/object:Gem::Version
54
40
  version: 0.18.1
55
41
  - !ruby/object:Gem::Dependency
56
- name: byebug
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: pry
42
+ name: rails
71
43
  requirement: !ruby/object:Gem::Requirement
72
44
  requirements:
73
45
  - - ">="
74
46
  - !ruby/object:Gem::Version
75
- version: '0'
47
+ version: 6.1.3.1
76
48
  type: :development
77
49
  prerelease: false
78
50
  version_requirements: !ruby/object:Gem::Requirement
79
51
  requirements:
80
52
  - - ">="
81
53
  - !ruby/object:Gem::Version
82
- version: '0'
54
+ version: 6.1.3.1
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: sqlite3
85
57
  requirement: !ruby/object:Gem::Requirement
86
58
  requirements:
87
59
  - - ">="
88
60
  - !ruby/object:Gem::Version
89
- version: '0'
61
+ version: 1.4.2
90
62
  type: :development
91
63
  prerelease: false
92
64
  version_requirements: !ruby/object:Gem::Requirement
93
65
  requirements:
94
66
  - - ">="
95
67
  - !ruby/object:Gem::Version
96
- version: '0'
68
+ version: 1.4.2
97
69
  description: The OhMySMTP Rails Gem is a plug in for ActionMailer to send emails via
98
70
  OhMySMTP to make sending emails from Rails apps super simple.
99
71
  email: