mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
43 lines
711 B
JavaScript
43 lines
711 B
JavaScript
|
module.exports = class EmailUnsubscribedEvent {
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {string}
|
||
|
*/
|
||
|
email;
|
||
|
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {string}
|
||
|
*/
|
||
|
memberId;
|
||
|
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {string}
|
||
|
*/
|
||
|
emailId;
|
||
|
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {Date}
|
||
|
*/
|
||
|
timestamp;
|
||
|
|
||
|
/**
|
||
|
* @private
|
||
|
*/
|
||
|
constructor({email, memberId, emailId, timestamp}) {
|
||
|
this.memberId = memberId;
|
||
|
this.emailId = emailId;
|
||
|
this.email = email;
|
||
|
this.timestamp = timestamp;
|
||
|
}
|
||
|
|
||
|
static create(data) {
|
||
|
return new EmailUnsubscribedEvent({
|
||
|
...data,
|
||
|
timestamp: data.timestamp || new Date
|
||
|
});
|
||
|
}
|
||
|
};
|