heya 0.5.2 → 0.5.3

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: 586da260567f71076b1e9820815e2508a74ac42104a1b099296f05c2a07cdb1a
4
- data.tar.gz: 354d3c9c0e7254063088b32edc0b5b4f877457121bf8f681b3e8c0fb1fbf91ee
3
+ metadata.gz: 971ee7f9d958554bbed7093180fd8af86e12f24c00a526be4e0361ab07657fe3
4
+ data.tar.gz: f0d0f2e54f9bea9f93f095a14f19844213347989f19b881e30fa3f46cc76825c
5
5
  SHA512:
6
- metadata.gz: 386d12c2aca08df55c2ca1e65f9691e120e3fa187ce3d5ba2e1168ddad3f2442b74e96763a430750a0f9c06270dac8a19bcf0413de5d2ae5833b7dd722632251
7
- data.tar.gz: e5286d6b20aab8f58a74eb6592ca4f99efbd0f8bdf8c17bd957f7f3fd33bc02d2023eeae4b37847614794ac91a29a8bbe972d7a38452da5834a474955cafc5d2
6
+ metadata.gz: b8da212577467f530326619471c1deb418bb71ed7109a105c47005a409ce008e1c211baa5e2e6b718dbda009efae940d282ddfb0b151d9ddb951c4dc732728a8
7
+ data.tar.gz: a6d53345cde9565b492dd7a99621db3e5762c1fd2ae8af8e565c3b69b19d887561dbb7fba32fafb74c7500c29e249e3e9f96ceb664e69cb8e5521f6693a5ae79
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
+ ### Added
9
+ - Create `bcc:` optional parameter for steps; use case is quality control
10
+
11
+ ## [0.5.2] - 2021-08-11
8
12
  ### Fixed
9
13
  - Fix typo in initializer (#139, @800a7b32)
10
14
 
data/README.md CHANGED
@@ -266,6 +266,28 @@ class OnboardingCampaign < ApplicationCampaign
266
266
  end
267
267
  ```
268
268
 
269
+ #### Quality control option
270
+
271
+ You may wish to apply quality control to individual steps of a campaign. For example, when adding a new step to an existing campaign it is
272
+ a good idea to inspect real-time results in production. You can do this by using the `bcc:` step option, which would look like this:
273
+
274
+ ```ruby
275
+ class OnboardingCampaign < ApplicationCampaign
276
+ default wait: 1.day,
277
+ queue: "onboarding",
278
+ from: "support@example.com"
279
+
280
+ # Will still be sent after one day from the
281
+ # email address support@example.com
282
+ step :welcome,
283
+ subject: "Welcome to my app!"
284
+
285
+ step :added_two_months_later,
286
+ subject: "We now have something new to say!",
287
+ bcc: 'quality_control@example.com'
288
+ end
289
+ ```
290
+
269
291
  #### Customizing email subjects for each user
270
292
 
271
293
  The subject can be customized for each user by using a `lambda` instead of a `String`:
@@ -10,6 +10,7 @@ module Heya
10
10
  step_name = step.name.underscore
11
11
 
12
12
  from = step.params.fetch("from")
13
+ bcc = step.params.fetch("bcc", nil)
13
14
  reply_to = step.params.fetch("reply_to", nil)
14
15
 
15
16
  subject = step.params.fetch("subject") {
@@ -22,6 +23,7 @@ module Heya
22
23
 
23
24
  mail(
24
25
  from: from,
26
+ bcc: bcc,
25
27
  reply_to: reply_to,
26
28
  to: user.email,
27
29
  subject: subject,
@@ -4,7 +4,7 @@ module Heya
4
4
  module Campaigns
5
5
  module Actions
6
6
  class Email < Action
7
- VALID_PARAMS = %w[subject from reply_to]
7
+ VALID_PARAMS = %w[subject from reply_to bcc]
8
8
 
9
9
  def self.validate_step(step)
10
10
  step.params.assert_valid_keys(VALID_PARAMS)
data/lib/heya/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Heya
4
- VERSION = "0.5.2"
4
+ VERSION = "0.5.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Wood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails