mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
90c9a03319
refs https://github.com/TryGhost/Team/issues/2253 refs https://github.com/TryGhost/Team/issues/2254 This package is analogous to the @tryghost/member-events package. The events here will be consumed by the EmailSuppressionList implementation and used to add emails to said list. They'll be dispatched by the code which handles events received from Mailgun.
47 lines
769 B
JavaScript
47 lines
769 B
JavaScript
/**
|
|
* @typedef {import('bson-objectid').default} ObjectID
|
|
*/
|
|
|
|
module.exports = class EmailBouncedEvent {
|
|
/**
|
|
* @readonly
|
|
* @type {string}
|
|
*/
|
|
email;
|
|
|
|
/**
|
|
* @readonly
|
|
* @type {ObjectID}
|
|
*/
|
|
memberId;
|
|
|
|
/**
|
|
* @readonly
|
|
* @type {ObjectID}
|
|
*/
|
|
emailId;
|
|
|
|
/**
|
|
* @readonly
|
|
* @type {Date}
|
|
*/
|
|
timestamp;
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
constructor({email, memberId, emailId, timestamp}) {
|
|
this.email = email;
|
|
this.memberId = memberId;
|
|
this.emailId = emailId;
|
|
this.timestamp = timestamp;
|
|
}
|
|
|
|
static create(data) {
|
|
return new EmailBouncedEvent({
|
|
...data,
|
|
timestamp: data.timestamp || new Date
|
|
});
|
|
}
|
|
};
|