heya 0.5.3 → 0.6.0

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: 971ee7f9d958554bbed7093180fd8af86e12f24c00a526be4e0361ab07657fe3
4
- data.tar.gz: f0d0f2e54f9bea9f93f095a14f19844213347989f19b881e30fa3f46cc76825c
3
+ metadata.gz: 6fd230aff6fc53ebfb1af3093b01c96b7c0480e0d67d6a3dee3ebb970009726d
4
+ data.tar.gz: 06aa85033434dfc827a6b341002c7da4e9f172340da0a2ff713e75085c1bffeb
5
5
  SHA512:
6
- metadata.gz: b8da212577467f530326619471c1deb418bb71ed7109a105c47005a409ce008e1c211baa5e2e6b718dbda009efae940d282ddfb0b151d9ddb951c4dc732728a8
7
- data.tar.gz: a6d53345cde9565b492dd7a99621db3e5762c1fd2ae8af8e565c3b69b19d887561dbb7fba32fafb74c7500c29e249e3e9f96ceb664e69cb8e5521f6693a5ae79
6
+ metadata.gz: a044d5ade5c1cc36367a486982afa4e522f3c83407d86df71058176c5406d8e3901aaf420a70866b3146f71edf4af8dd4ac204bf5446b47d613ec5aa3163bc93
7
+ data.tar.gz: 2820502a0d9a141df3ac428d71aba1768576e90e56cd1e5b58fe7cfe970a5413409bf9e95a9c0decfbd73066a8d13ebfe12c6b6ee759b172c35ae460bf46afdc
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
  ### Added
9
+ - Optional `layout` parameter for steps; allowing override from default `heya/campaign_mailer`
10
+
11
+ ## [0.5.3] - 2021-08-18
12
+ ### Added
9
13
  - Create `bcc:` optional parameter for steps; use case is quality control
10
14
 
11
15
  ## [0.5.2] - 2021-08-11
data/README.md CHANGED
@@ -250,6 +250,7 @@ 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,7 +258,8 @@ You can change the default options using the `default` method at the top of the
257
258
  class OnboardingCampaign < ApplicationCampaign
258
259
  default wait: 1.day,
259
260
  queue: "onboarding",
260
- from: "support@example.com"
261
+ from: "support@example.com",
262
+ layout: "onboarding"
261
263
 
262
264
  # Will still be sent after one day from the
263
265
  # email address support@example.com
@@ -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)
@@ -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 bcc]
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.3"
4
+ VERSION = "0.6.0"
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.3
4
+ version: 0.6.0
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-18 00:00:00.000000000 Z
11
+ date: 2021-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -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"