heya 0.5.1 → 0.6.1

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: d6e0b9d8f683a3fa919bd5cdd2574d5894c334937e963512eab4ee8bc54b42a5
4
- data.tar.gz: d0a207668ad43fcd6750860a0af85a131ee8b8b168c082c5c2919cc49ad9aa9a
3
+ metadata.gz: cc54010af38a9f2e0e58358f998ad7b81480955416bac5ae1a18c9b5dfdfecd3
4
+ data.tar.gz: ef7dbf811f3fec3c2e10e1d569f82aed0ae3309291f21a196c3dd43d28e7bf8e
5
5
  SHA512:
6
- metadata.gz: fd07083120bbf4110fd60b8661dc4d0e4fa7b0ecaf0d29c11a74a6e68589dc06e12be2efe8ccacfcf924313006342cb9e413878e83bf6cd32df18d0a07c6c194
7
- data.tar.gz: 17636d925028392b6ba153142d7f5513578fb3364d9b39eb3cd74cc0fcbbfcec454b2ece88ba4344e5344fb9ebc78461b200b8446eb8d1cdf6278c55177a4a72
6
+ metadata.gz: 76e3d5d214c06a53cd03c388682e5c22984c874f56e73c1ebf321b08f011fd513f2402fa4e05d6abea9fe7e705f0d1330645e38de86a541210431370ec2ec71a
7
+ data.tar.gz: ac526b113dc81c207e7a26783b7ae63db6ccba85a2588906277eb7eaeda627930037fd195dd23c110b753fe961723b885f19d03f4f0f5a203031d18638ec53a3
data/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ 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
+
9
+ ## [0.6.1] - 2022-01-05
10
+ ### Fixed
11
+ - Support Rails 7 (#151, @800a7b32)
12
+
13
+ ## [0.6.0] - 2021-11-02
14
+ ### Added
15
+ - Optional `layout` parameter for steps; allowing override from default `heya/campaign_mailer`
16
+
17
+ ## [0.5.3] - 2021-08-18
18
+ ### Added
19
+ - Create `bcc:` optional parameter for steps; use case is quality control
20
+
21
+ ## [0.5.2] - 2021-08-11
22
+ ### Fixed
23
+ - Fix typo in initializer (#139, @800a7b32)
24
+
25
+ ## [0.5.1] - 2021-07-13
8
26
  ### Fixed
9
27
  - Fix compatibility with Rails 6.1.4 (introduced by [this change](https://github.com/rails/rails/commit/99049262d37fedcd25af91231423103b0d218694#diff-79b53b2602bf702bdd8ce677e096be6a6923a54236e17237c16068a510078683) to `build_arel`) (#137, @retsef)
10
28
 
data/README.md CHANGED
@@ -250,9 +250,29 @@ Heya uses the following additional options to build the message itself:
250
250
  | :---------- | :----------- | :------------------------- |
251
251
  | `subject` | **required** | The email's subject |
252
252
  | `from` | Heya default | The sender's email address |
253
+ | `layout` | Heya default | The email's layout file |
253
254
 
254
255
  You can change the default options using the `default` method at the top of the campaign. Heya applies default options to each step which doesn't supply its own:
255
256
 
257
+ ```ruby
258
+ class OnboardingCampaign < ApplicationCampaign
259
+ default wait: 1.day,
260
+ queue: "onboarding",
261
+ from: "support@example.com",
262
+ layout: "onboarding"
263
+
264
+ # Will still be sent after one day from the
265
+ # email address support@example.com
266
+ step :welcome,
267
+ subject: "Welcome to my app!"
268
+ end
269
+ ```
270
+
271
+ #### Quality control option
272
+
273
+ 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
274
+ 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:
275
+
256
276
  ```ruby
257
277
  class OnboardingCampaign < ApplicationCampaign
258
278
  default wait: 1.day,
@@ -263,6 +283,10 @@ class OnboardingCampaign < ApplicationCampaign
263
283
  # email address support@example.com
264
284
  step :welcome,
265
285
  subject: "Welcome to my app!"
286
+
287
+ step :added_two_months_later,
288
+ subject: "We now have something new to say!",
289
+ bcc: 'quality_control@example.com'
266
290
  end
267
291
  ```
268
292
 
@@ -1,6 +1,7 @@
1
1
  module Heya
2
2
  class CampaignMailer < ApplicationMailer
3
- layout "heya/campaign_mailer"
3
+ DEFAULT_LAYOUT = "heya/campaign_mailer"
4
+ layout -> { params.fetch(:step).params.fetch("layout", DEFAULT_LAYOUT) }
4
5
 
5
6
  def build
6
7
  user = params.fetch(:user)
@@ -10,6 +11,7 @@ module Heya
10
11
  step_name = step.name.underscore
11
12
 
12
13
  from = step.params.fetch("from")
14
+ bcc = step.params.fetch("bcc", nil)
13
15
  reply_to = step.params.fetch("reply_to", nil)
14
16
 
15
17
  subject = step.params.fetch("subject") {
@@ -22,6 +24,7 @@ module Heya
22
24
 
23
25
  mail(
24
26
  from: from,
27
+ bcc: bcc,
25
28
  reply_to: reply_to,
26
29
  to: user.email,
27
30
  subject: subject,
@@ -8,7 +8,7 @@ Heya.configure do |config|
8
8
  # Campaign priority. When a user is added to multiple campaigns, they are
9
9
  # sent in this order. Campaigns are sent in the order that the users were
10
10
  # added if no priority is configured.
11
- # config.campaings.priority = [
11
+ # config.campaigns.priority = [
12
12
  # "FirstCampaign",
13
13
  # "SecondCampaign",
14
14
  # "ThirdCampaign"
@@ -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 layout]
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.1"
4
+ VERSION = "0.6.1"
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.1
4
+ version: 0.6.1
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-07-13 00:00:00.000000000 Z
11
+ date: 2022-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 5.2.3
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 6.2.0
22
+ version: 7.1.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 5.2.3
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 6.2.0
32
+ version: 7.1.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: pg
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.2.3
134
+ rubygems_version: 3.2.22
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: "Heya \U0001F44B"