brevo1.0.0980 B
const SibApiV3Sdk = require('sib-api-v3-sdk');
const defaultClient = SibApiV3Sdk.ApiClient.instance;
let apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = process.env.BREVO_API_KEY;
const apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();
let sendSmtpEmail = new SibApiV3Sdk.SendSmtpEmail();
export const sendBrevoEmail = async (params, callBack) => {
try {
sendSmtpEmail = {
to: [{ email: params.email }],
templateId: params.templateId,
params,
headers: {
'X-Mailin-custom': 'custom_header_1:custom_value_1|custom_header_2:custom_value_2'
}
};
if (params?.CCemail) {
sendSmtpEmail.cc = params.CCemail
}
if (params?.BCCemail) {
sendSmtpEmail.bcc = params.BCCemail
}
apiInstance.sendTransacEmail(sendSmtpEmail).then(callBack)
} catch (err) {
throw err
}
}
Shown as plain text from the published tarball, after apm checked it against the version's checksum. Nothing in it runs on this page.