mailersend
Version:
Node.js helper module for MailerSend API
93 lines (92 loc) • 3.06 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmailParams = void 0;
class EmailParams {
constructor(config) {
this.from = config === null || config === void 0 ? void 0 : config.from;
this.to = config === null || config === void 0 ? void 0 : config.to;
this.cc = config === null || config === void 0 ? void 0 : config.cc;
this.bcc = config === null || config === void 0 ? void 0 : config.bcc;
this.reply_to = config === null || config === void 0 ? void 0 : config.replyTo;
this.in_reply_to = config === null || config === void 0 ? void 0 : config.inReplyTo;
this.subject = config === null || config === void 0 ? void 0 : config.subject;
this.text = config === null || config === void 0 ? void 0 : config.text;
this.html = config === null || config === void 0 ? void 0 : config.html;
this.send_at = config === null || config === void 0 ? void 0 : config.sendAt;
this.attachments = config === null || config === void 0 ? void 0 : config.attachments;
this.template_id = config === null || config === void 0 ? void 0 : config.templateId;
this.tags = config === null || config === void 0 ? void 0 : config.tags;
this.personalization = config === null || config === void 0 ? void 0 : config.personalization;
this.precedence_bulk = config === null || config === void 0 ? void 0 : config.precedenceBulk;
this.list_unsubscribe = config === null || config === void 0 ? void 0 : config.listUnsubscribe;
}
setFrom(from) {
this.from = from;
return this;
}
setTo(to) {
this.to = to;
return this;
}
setCc(cc) {
this.cc = cc;
return this;
}
setBcc(bcc) {
this.bcc = bcc;
return this;
}
setReplyTo(replyTo) {
this.reply_to = replyTo;
return this;
}
setInReplyTo(inReplyTo) {
this.in_reply_to = inReplyTo;
return this;
}
setSubject(subject) {
this.subject = subject;
return this;
}
setText(text) {
this.text = text;
return this;
}
setHtml(html) {
this.html = html;
return this;
}
setSendAt(sendAt) {
this.send_at = sendAt;
return this;
}
setAttachments(attachments) {
this.attachments = attachments;
return this;
}
setTemplateId(id) {
this.template_id = id;
return this;
}
setTags(tags) {
this.tags = tags;
return this;
}
setPersonalization(personalization) {
this.personalization = personalization;
return this;
}
setPrecedenceBulk(precedenceBulk) {
this.precedence_bulk = precedenceBulk;
return this;
}
setSettings(settings) {
this.settings = settings;
return this;
}
setListUnsubscribe(listUnsubscribe) {
this.list_unsubscribe = listUnsubscribe;
return this;
}
}
exports.EmailParams = EmailParams;