UNPKG

mailersend

Version:

Node.js helper module for MailerSend API

75 lines (74 loc) 2.92 kB
"use strict"; 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; this.version = config.version; this.editable = config.editable; } } 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; } setEditable(editable) { this.editable = editable; return this; } setVersion(version) { this.version = version; 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_COMPLAINT"] = "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["DEFERRED"] = "activity.deferred"; EmailWebhookEventType["INBOUND_FORWARD_FAILED"] = "inbound_forward.failed"; EmailWebhookEventType["EMAIL_SINGLE_VERIFIED"] = "email_single.verified"; EmailWebhookEventType["EMAIL_LIST_VERIFIED"] = "email_list.verified"; EmailWebhookEventType["BULK_EMAIL_COMPLETED"] = "bulk_email.completed"; EmailWebhookEventType["RECIPIENT_ON_HOLD_ADDED"] = "recipient.on_hold_added"; EmailWebhookEventType["RECIPIENT_ON_HOLD_REMOVED"] = "recipient.on_hold_removed"; })(EmailWebhookEventType || (exports.EmailWebhookEventType = EmailWebhookEventType = {}));