Ghost/ghost/milestones
Aileen Booker 2f57e95a5d
Slack notifications service for Milestones behind flag (#16281)
refs
https://www.notion.so/ghost/Marketing-Milestone-email-campaigns-1d2c9dee3cfa4029863edb16092ad5c4?pvs=4

- Added a `slack-notifications` repository which handles sending Slack
messages to a URL as defined in our Ghost(Pro) config (also includes a
global switch to disable the feature if needed) and listens to
`MilestoneCreatedEvents`.
- Added a `slack-notification` service which listens to the events on
boot.
- In order to have access to further information such as the reason why
a Milestone email hasn't been sent, or the current ARR or Member value
as comparison to the achieved milestone, I added a `meta` object to the
`MilestoneCreatedEvent` which then gets accessible by the event
subscriber. This avoid doing further requests to the DB as we need to
have this information in relation to the event occurred.

---------

Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
2023-02-17 12:59:18 +02:00
..
lib Slack notifications service for Milestones behind flag (#16281) 2023-02-17 12:59:18 +02:00
test Slack notifications service for Milestones behind flag (#16281) 2023-02-17 12:59:18 +02:00
.eslintrc.js Renamed milestone-emails to milestones 2023-02-15 10:43:05 +02:00
index.js Renamed milestone-emails to milestones 2023-02-15 10:43:05 +02:00
package.json Update dependency c8 to v7.13.0 2023-02-16 22:15:50 +00:00
README.md Renamed milestone-emails to milestones 2023-02-15 10:43:05 +02:00

Milestones

Checking milestone defined milestone goals and sending events when achieved

Usage

Develop

This is a monorepo package.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Test

  • yarn lint run just eslint
  • yarn test run lint and tests