Ghost/ghost/member-events
Simon Backx 31a4135fec
Added members.last_commented_at and last_seen_at update when commenting (#15088)
refs https://github.com/TryGhost/Team/issues/1717

- Updates last_commented_at and last_seen_at (only once a day)
- Used the LastSeenAtUpdater, so we can combine updating last_commented_at and last_seen_at in one query + used same pattern
- Updated comments service to await emails in order to make E2E tests more stable (as we don't have any method to await emails and test emails otherwise). This removed the email sending logic from the `onCreated` hook of the model.
2022-07-25 17:35:46 +02:00
..
lib Added members.last_commented_at and last_seen_at update when commenting (#15088) 2022-07-25 17:35:46 +02:00
test Added @tryghost/member-events 2021-09-17 15:22:08 +02:00
.eslintrc.js Added @tryghost/member-events 2021-09-17 15:22:08 +02:00
index.js Added members.last_commented_at and last_seen_at update when commenting (#15088) 2022-07-25 17:35:46 +02:00
package.json Removed repository from component package.json files 2022-07-25 11:15:16 +02:00
README.md Tidied up package READMEs 2022-07-25 15:17:12 +02:00

Member Events

Usage

const {MemberEntryViewEvent} = require('@tryghost/member-events');

const event = MemberEntryViewEvent.create({
    memberId: member.id,
    memberStatus: member.status,
    entryId: post.id,
    entryUrl: post.url
});

const DomainEvents = require('@tryghost/domain-events');

DomainEvents.dispatch(event);