heya 0.8.0 → 0.10.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 +12 -0
- data/README.md +4 -3
- data/app/mailers/heya/campaign_mailer.rb +9 -6
- data/lib/generators/heya/campaign/campaign_generator.rb +10 -2
- data/lib/generators/heya/campaign/templates/message.md.erb.tt +1 -1
- data/lib/generators/heya/campaign/templates/message.text.erb.tt +1 -1
- data/lib/heya/campaigns/base.rb +1 -1
- data/lib/heya/engine.rb +12 -0
- data/lib/heya/version.rb +1 -1
- metadata +4 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8640e8fc2f4d593d85d4417b2f149d0afda39a88ffa3881f5558988c5ddda694
|
4
|
+
data.tar.gz: 3e4c574c46b7fad452c6a0394fafbab5730e51d3927798c30a38284f8ae35f61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a042f0c2280489b968c7882bcc1f850c95c67ab15cd0a2c90cc8adcacd55134628c75a2e2284eb24b2791f20ada01c4b6cd17b1d475d5a7970c9e96d06653ec
|
7
|
+
data.tar.gz: bef8ea2e36960de46f733eb12418b261a9241698d9d60f4b2277b34a2063b49f54a378f007643c54d49208f92c13612fd37310c2b71cebda720527c389a93608
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
### Added
|
9
|
+
- Add lambda support for from, bcc, and reply_to campaign options (#233, @armiiller)
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
- Fix a Rails startup bug when validating steps that use translations from locale
|
13
|
+
files. (#211)
|
14
|
+
|
15
|
+
## [0.9.0] - 2023-10-06
|
16
|
+
### Added
|
17
|
+
- Rails 7.1 support
|
18
|
+
|
19
|
+
## [0.8.0] - 2023-03-28
|
20
|
+
### Added
|
9
21
|
- Add `:headers` mail option (#202, @montekaka)
|
10
22
|
|
11
23
|
### Fixed
|
data/README.md
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/heya.svg)](https://badge.fury.io/rb/heya)
|
4
4
|
[![Maintainability](https://api.codeclimate.com/v1/badges/a6416e63ffc426715857/maintainability)](https://codeclimate.com/github/honeybadger-io/heya/maintainability)
|
5
5
|
|
6
|
-
[![Twitter Follow](https://img.shields.io/twitter/follow/heyjoshwood?label=Follow%20Josh%20for%20dev%20updates&style=social)](https://mobile.twitter.com/heyjoshwood)
|
7
|
-
|
8
6
|
Heya is a campaign mailer for Rails. Think of it like ActionMailer, but for timed email sequences. It can also perform other actions like sending a text message.
|
9
7
|
|
10
8
|
## Getting started
|
@@ -14,6 +12,9 @@ Getting started with Heya is easy:
|
|
14
12
|
2. [Create a campaign](#creating-your-first-campaign)
|
15
13
|
3. [Run the scheduler](#running-the-scheduler)
|
16
14
|
|
15
|
+
### Prerequisites
|
16
|
+
Heya was built to work with PostgreSQL. Pull requests are welcome to support more databases.
|
17
|
+
|
17
18
|
### Installing the Heya gem
|
18
19
|
1. Add this line to your application's Gemfile:
|
19
20
|
|
@@ -615,7 +616,7 @@ considering adding to Heya.
|
|
615
616
|
2. `gem bump -v [version] -t -r`
|
616
617
|
3. Update unreleased heading in [CHANGELOG.md](./CHANGELOG.md) (TODO: automate
|
617
618
|
this in gem-release command)
|
618
|
-
4. `git push origin
|
619
|
+
4. `git push origin main --tags`
|
619
620
|
|
620
621
|
## License
|
621
622
|
Heya is licensed under the [LGPL](./LICENSE).
|
@@ -12,8 +12,13 @@ module Heya
|
|
12
12
|
step_name = step.name.underscore
|
13
13
|
|
14
14
|
from = step.params.fetch("from")
|
15
|
+
from = from.call(user) if from.respond_to?(:call)
|
16
|
+
|
15
17
|
bcc = step.params.fetch("bcc", nil)
|
18
|
+
bcc = bcc.call(user) if bcc.respond_to?(:call)
|
19
|
+
|
16
20
|
reply_to = step.params.fetch("reply_to", nil)
|
21
|
+
reply_to = reply_to.call(user) if reply_to.respond_to?(:call)
|
17
22
|
|
18
23
|
subject = step.params.fetch("subject") {
|
19
24
|
I18n.t("#{campaign_name}.#{step_name}.subject", **attributes_for(user))
|
@@ -48,12 +53,10 @@ module Heya
|
|
48
53
|
end
|
49
54
|
|
50
55
|
def _prefixes
|
51
|
-
@_prefixes_with_campaign_path ||=
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
super
|
56
|
-
end
|
56
|
+
@_prefixes_with_campaign_path ||= if params.is_a?(Hash) && (campaign_name = params[:step]&.campaign&.name&.underscore)
|
57
|
+
super | ["heya/campaign_mailer/#{campaign_name}"]
|
58
|
+
else
|
59
|
+
super
|
57
60
|
end
|
58
61
|
end
|
59
62
|
|
@@ -62,8 +62,16 @@ class Heya::CampaignGenerator < Rails::Generators::NamedBase
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def preview_path
|
65
|
-
@preview_path ||=
|
66
|
-
|
65
|
+
@preview_path ||= begin
|
66
|
+
preview_path = if ActionMailer::Base.respond_to?(:preview_paths)
|
67
|
+
# Rails 7.1+
|
68
|
+
ActionMailer::Base.preview_paths.first
|
69
|
+
else
|
70
|
+
# Rails < 7.1
|
71
|
+
ActionMailer::Base.preview_path
|
72
|
+
end
|
73
|
+
|
74
|
+
Pathname(preview_path).sub(Rails.root.to_s, ".") if preview_path
|
67
75
|
end
|
68
76
|
end
|
69
77
|
end
|
@@ -1 +1 @@
|
|
1
|
-
This is the <%= @step.downcase %>
|
1
|
+
This is the <%= @step.downcase %> message.
|
@@ -1 +1 @@
|
|
1
|
-
This is the <%= @step.downcase %>
|
1
|
+
This is the <%= @step.downcase %> message.
|
data/lib/heya/campaigns/base.rb
CHANGED
data/lib/heya/engine.rb
CHANGED
@@ -11,6 +11,18 @@ module Heya
|
|
11
11
|
end
|
12
12
|
|
13
13
|
config.to_prepare do
|
14
|
+
# This runs the first time *before* Rails is initialized. Because
|
15
|
+
# campaigns depend on Rails initialization, we use the `after_initialize`
|
16
|
+
# hook when Rails first starts up, and then `to_prepare` when reloading
|
17
|
+
# in development. See https://github.com/honeybadger-io/heya/issues/211
|
18
|
+
if ::Rails.application.initialized?
|
19
|
+
Dir.glob(Rails.root + "app/campaigns/*.rb").each do |c|
|
20
|
+
require_dependency(c)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
config.after_initialize do
|
14
26
|
Dir.glob(Rails.root + "app/campaigns/*.rb").each do |c|
|
15
27
|
require_dependency(c)
|
16
28
|
end
|
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.10.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:
|
11
|
+
date: 2024-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 5.2.3
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 7.1.0
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 5.2.3
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 7.1.0
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: pg
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +108,7 @@ files:
|
|
114
108
|
- lib/tasks/heya_tasks.rake
|
115
109
|
homepage: https://github.com/honeybadger-io/heya
|
116
110
|
licenses:
|
117
|
-
-
|
111
|
+
- LGPL-3.0
|
118
112
|
metadata: {}
|
119
113
|
post_install_message: Upgrading from Heya < 0.4? See https://git.io/JtgmW
|
120
114
|
rdoc_options: []
|
@@ -131,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
125
|
- !ruby/object:Gem::Version
|
132
126
|
version: '0'
|
133
127
|
requirements: []
|
134
|
-
rubygems_version: 3.
|
128
|
+
rubygems_version: 3.4.10
|
135
129
|
signing_key:
|
136
130
|
specification_version: 4
|
137
131
|
summary: "Heya \U0001F44B"
|