heya 0.4.0 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +22 -0
- data/app/mailers/heya/campaign_mailer.rb +3 -0
- 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: 971ee7f9d958554bbed7093180fd8af86e12f24c00a526be4e0361ab07657fe3
|
4
|
+
data.tar.gz: f0d0f2e54f9bea9f93f095a14f19844213347989f19b881e30fa3f46cc76825c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8da212577467f530326619471c1deb418bb71ed7109a105c47005a409ce008e1c211baa5e2e6b718dbda009efae940d282ddfb0b151d9ddb951c4dc732728a8
|
7
|
+
data.tar.gz: a6d53345cde9565b492dd7a99621db3e5762c1fd2ae8af8e565c3b69b19d887561dbb7fba32fafb74c7500c29e249e3e9f96ceb664e69cb8e5521f6693a5ae79
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,20 @@ 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
|
12
|
+
### Fixed
|
13
|
+
- Fix typo in initializer (#139, @800a7b32)
|
14
|
+
|
15
|
+
## [0.5.1] - 2021-07-13
|
16
|
+
### Fixed
|
17
|
+
- 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)
|
18
|
+
|
19
|
+
## [0.5.0] - 2021-06-17
|
20
|
+
### Added
|
21
|
+
- Create `@campaign_name` instance var accessible in email templates (#135)
|
8
22
|
|
9
23
|
## [0.4.0] - 2021-02-04
|
10
24
|
### Changed
|
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") {
|
@@ -18,9 +19,11 @@ module Heya
|
|
18
19
|
subject = subject.call(user) if subject.respond_to?(:call)
|
19
20
|
|
20
21
|
instance_variable_set(:"@#{user.model_name.element}", user)
|
22
|
+
instance_variable_set(:@campaign_name, campaign_name)
|
21
23
|
|
22
24
|
mail(
|
23
25
|
from: from,
|
26
|
+
bcc: bcc,
|
24
27
|
reply_to: reply_to,
|
25
28
|
to: user.email,
|
26
29
|
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.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-
|
11
|
+
date: 2021-08-18 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.
|
134
|
+
rubygems_version: 3.2.3
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: "Heya \U0001F44B"
|