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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b86343f81143907f3df739be458355fd5ac083cc83c6785a8eb3c45b4f2d2e3c
4
- data.tar.gz: 2db76cad93eeb4e5fa551ca7b7a5a9734c81b1d50c64acdbba7e5f71d75cc579
3
+ metadata.gz: 71a903596aa63a03c214e5367c603b3941b8ee4d4f002383208534c31f2c4d7a
4
+ data.tar.gz: a86e68e87419b3d40317b31beb76bf2ff3f0cf36915ae45e8a4f4cdd52422bf5
5
5
  SHA512:
6
- metadata.gz: 167fd6de8a0e985d09baa86ef49e63c9a7d5e642732e10cc6812dcc2bc562a6e1fc95a3910691a18450dd84ff6440ec69a884cd53f8fb236e12fb032e6fe5a97
7
- data.tar.gz: 2fb90a8b7a4ad78a8b8c5163bbf9585552fc0e72522d19d0c7779b1706e084899f347932bc5e70741ad64dad83a8bc5a31dae7e07ef8028e20adc4503f778c95
6
+ metadata.gz: 76590506bc73dc5f875551021183080e0693ce242278401519a0c0c77c36b4ea0861b96e738a0f5491aa6c6029217b5c6d52b5248fd6e963e65eedfe494df721
7
+ data.tar.gz: 4b0cae0a80716e081a519d14b83a56dd545578ac3a45a9e59af7ca6429f610e93f2d180f3de0b57e512134190ab1e3c2f73c5ae2d0afedf6fb348468cdbff6f7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.0 - 2021-05-07
4
+
5
+ ### Added
6
+ - add mailer job.
7
+
3
8
  ## v0.2.0 - 2021-04-25
4
9
 
5
10
  ### Added
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Postburner
2
- VERSION = '0.2.2'
2
+ VERSION = '0.3.0'
3
3
  end
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.2.2
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-05 00:00:00.000000000 Z
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