mailersend
Version:
Node.js helper module for MailerSend API
58 lines (57 loc) • 2.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmailWebhookEventType = exports.EmailWebhook = void 0;
class EmailWebhook {
constructor(config) {
if (config) {
this.url = config.url;
this.name = config.name;
this.events = config.events;
this.domain_id = config.domain_id;
this.enabled = config.enabled;
}
}
setUrl(url) {
this.url = url;
return this;
}
setName(name) {
this.name = name;
return this;
}
setEvents(events) {
this.events = events;
return this;
}
/**
* Set domain id
* @param domainId - Existing hashed domain ID.
*/
setDomainId(domainId) {
this.domain_id = domainId;
return this;
}
setEnabled(enabled) {
this.enabled = enabled;
return this;
}
}
exports.EmailWebhook = EmailWebhook;
var EmailWebhookEventType;
(function (EmailWebhookEventType) {
EmailWebhookEventType["SENT"] = "activity.sent";
EmailWebhookEventType["DELIVERED"] = "activity.delivered";
EmailWebhookEventType["SOFT_BOUNCED"] = "activity.soft_bounced";
EmailWebhookEventType["HARD_BOUNCED"] = "activity.hard_bounced";
EmailWebhookEventType["OPENED"] = "activity.opened";
EmailWebhookEventType["OPENED_UNIQUE"] = "activity.opened_unique";
EmailWebhookEventType["CLICKED"] = "activity.clicked";
EmailWebhookEventType["CLICKED_UNIQUE"] = "activity.clicked_unique";
EmailWebhookEventType["UNSUBSCRIBED"] = "activity.unsubscribed";
EmailWebhookEventType["SPAM_COMPLIANT"] = "activity.spam_complaint";
EmailWebhookEventType["SURVEY_OPENED"] = "activity.survey_opened";
EmailWebhookEventType["SURVEY_SUBMITTED"] = "activity.survey_submitted";
EmailWebhookEventType["IDENTITY_VERIFIED"] = "sender_identity.verified";
EmailWebhookEventType["MAINTENANCE_START"] = "maintenance.start";
EmailWebhookEventType["MAINTENANCE_END"] = "maintenance.end";
})(EmailWebhookEventType || (exports.EmailWebhookEventType = EmailWebhookEventType = {}));