sendwithus_ruby_action_mailer 0.3.0 → 0.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b5ed4fd380e163f80dcfa9072963cb10ffa2c0e
|
4
|
+
data.tar.gz: decd4114b665b03bd3d9c6aa360201e11ea16845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17749e64d882871acb621e98708531d0983feaa815485c1b0d80e79b33286586304668cbdb5d38fe3e495b6a3f8f1b97c060e0b7f016a120eab76cecd8ecdcdf
|
7
|
+
data.tar.gz: b9619fcb4f91c8fb1249427c7bb5a1c92121849e0004e8f67a28a6661814bc9680679b4eed1fa20c65340221e30c6466d7fd8b6c36267f911da5c1756e32aa0c
|
data/README.md
CHANGED
@@ -94,6 +94,24 @@ You never instantiate your mailer class. Rather, you just call the method you de
|
|
94
94
|
on the class itself.
|
95
95
|
|
96
96
|
|
97
|
+
### Conditional Delivery
|
98
|
+
|
99
|
+
If you have to check for a condition for senting the email (useful when it's a scheduled sending with Sidekiq for instance), you can simply not call the mail method and the email won't be sent out.
|
100
|
+
|
101
|
+
`````Ruby
|
102
|
+
class Notifier < SendWithUsMailer::Base
|
103
|
+
def we_miss_you(user_id)
|
104
|
+
user = User.find user_id
|
105
|
+
if user.do_we_miss_him?
|
106
|
+
mail(
|
107
|
+
email_id: 'ID-CODE-FROM-SEND-WITH-US',
|
108
|
+
recipient_address: user.email
|
109
|
+
)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
`````
|
114
|
+
|
97
115
|
### Default Hash
|
98
116
|
|
99
117
|
SendWithUsMailer allows you to specify default values inside the class definition:
|
@@ -58,8 +58,14 @@ describe SendWithUsMailer::MailParams do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
it "calls the send_with_us gem" do
|
61
|
+
subject.merge!(email_id: 'x')
|
61
62
|
SendWithUs::Api.any_instance.expects(:send_email)
|
62
63
|
subject.deliver
|
63
64
|
end
|
65
|
+
|
66
|
+
it "doesnt call the send_with_us gem if mail method is not called" do
|
67
|
+
SendWithUs::Api.any_instance.expects(:send_with).never
|
68
|
+
subject.deliver
|
69
|
+
end
|
64
70
|
end
|
65
|
-
end
|
71
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendwithus_ruby_action_mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Rempel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: send_with_us
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
126
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.4.
|
127
|
+
rubygems_version: 2.4.5
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: An ActionMailer look alike for Send With Us.
|