heya 0.5.0 → 0.6.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 +16 -0
- data/README.md +24 -0
- data/app/mailers/heya/campaign_mailer.rb +4 -1
- data/lib/generators/heya/install/templates/initializer.rb.tt +1 -1
- data/lib/heya/active_record_extension.rb +1 -1
- data/lib/heya/campaigns/actions/email.rb +1 -1
- data/lib/heya/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fd230aff6fc53ebfb1af3093b01c96b7c0480e0d67d6a3dee3ebb970009726d
|
4
|
+
data.tar.gz: 06aa85033434dfc827a6b341002c7da4e9f172340da0a2ff713e75085c1bffeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a044d5ade5c1cc36367a486982afa4e522f3c83407d86df71058176c5406d8e3901aaf420a70866b3146f71edf4af8dd4ac204bf5446b47d613ec5aa3163bc93
|
7
|
+
data.tar.gz: 2820502a0d9a141df3ac428d71aba1768576e90e56cd1e5b58fe7cfe970a5413409bf9e95a9c0decfbd73066a8d13ebfe12c6b6ee759b172c35ae460bf46afdc
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,22 @@ 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
|
13
|
+
- Create `bcc:` optional parameter for steps; use case is quality control
|
14
|
+
|
15
|
+
## [0.5.2] - 2021-08-11
|
16
|
+
### Fixed
|
17
|
+
- Fix typo in initializer (#139, @800a7b32)
|
18
|
+
|
19
|
+
## [0.5.1] - 2021-07-13
|
20
|
+
### Fixed
|
21
|
+
- 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)
|
22
|
+
|
23
|
+
## [0.5.0] - 2021-06-17
|
24
|
+
### Added
|
9
25
|
- Create `@campaign_name` instance var accessible in email templates (#135)
|
10
26
|
|
11
27
|
## [0.4.0] - 2021-02-04
|
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
|
-
|
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.
|
11
|
+
# config.campaigns.priority = [
|
12
12
|
# "FirstCampaign",
|
13
13
|
# "SecondCampaign",
|
14
14
|
# "ThirdCampaign"
|
data/lib/heya/version.rb
CHANGED
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.
|
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-
|
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.
|
134
|
+
rubygems_version: 3.2.22
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: "Heya \U0001F44B"
|