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