postburner 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/models/postburner/mailer.rb +25 -0
- data/lib/postburner/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71a903596aa63a03c214e5367c603b3941b8ee4d4f002383208534c31f2c4d7a
|
4
|
+
data.tar.gz: a86e68e87419b3d40317b31beb76bf2ff3f0cf36915ae45e8a4f4cdd52422bf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76590506bc73dc5f875551021183080e0693ce242278401519a0c0c77c36b4ea0861b96e738a0f5491aa6c6029217b5c6d52b5248fd6e963e65eedfe494df721
|
7
|
+
data.tar.gz: 4b0cae0a80716e081a519d14b83a56dd545578ac3a45a9e59af7ca6429f610e93f2d180f3de0b57e512134190ab1e3c2f73c5ae2d0afedf6fb348468cdbff6f7
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
module Postburner
|
2
|
+
# Send a mailer, tracked.
|
3
|
+
#
|
4
|
+
# Postburner::Mailer.deliver(UserMailer, :welcome, user_id: 1)
|
5
|
+
# Postburner::Mailer.deliver(UserMailer, :welcome, user_id: 1).queue! at: Time.zone.now + 1.day
|
6
|
+
# Postburner::Mailer.deliver(UserMailer, :welcome, user_id: 1).queue! delay: 5.minutes
|
7
|
+
class Mailer < Job
|
8
|
+
#queue 'mailers'
|
9
|
+
|
10
|
+
def self.deliver!(mailer, action)
|
11
|
+
job = self.create!(
|
12
|
+
args: {
|
13
|
+
mailer: mailer.to_s,
|
14
|
+
action: action.to_s,
|
15
|
+
}
|
16
|
+
)
|
17
|
+
job
|
18
|
+
end
|
19
|
+
|
20
|
+
def process(args)
|
21
|
+
cls = args['mailer'].constantize
|
22
|
+
cls.send(args['action']).deliver_now
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/postburner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postburner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- app/mailers/postburner/application_mailer.rb
|
94
94
|
- app/models/postburner/application_record.rb
|
95
95
|
- app/models/postburner/job.rb
|
96
|
+
- app/models/postburner/mailer.rb
|
96
97
|
- app/views/layouts/postburner/application.html.haml
|
97
98
|
- app/views/postburner/jobs/index.html.haml
|
98
99
|
- app/views/postburner/jobs/show.html.haml
|