"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dd_api_1 = __importDefault(require("../dd-api"));
const functions_1 = require("../../helpers/functions");
class DDEmailApi extends dd_api_1.default {
    constructor(settings, client) {
        super(settings, client);
    }
    async sendTransactionalEmail(payload) {
        const toAddresses = (0, functions_1.cleanEmails)(payload.toAddresses);
        const ccAddresses = (0, functions_1.cleanEmails)(payload.ccAddresses);
        const bccAddresses = (0, functions_1.cleanEmails)(payload.bccAddresses);
        const fromAddress = (0, functions_1.checkAndCleanEmail)(payload.fromAddress);
        return await this.post('/v2/email', {
            ToAddresses: toAddresses,
            CCAddresses: ccAddresses,
            BCCAddresses: bccAddresses,
            Subject: payload.subject,
            FromAddress: fromAddress,
            HtmlContent: payload.htmlContent,
            PlainTextContent: payload.plainTextContent
        });
    }
}
exports.default = DDEmailApi;
//# sourceMappingURL=dd-email-api.js.map