Created
July 31, 2022 00:44
-
-
Save EverettBerry/21337159862b8f97a112946e8c6f8a37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { TrackClient, RegionUS, SendEmailRequest, APIClient } = require('customerio-node') | |
const customerioSiteId = process.env.CUSTOMER_IO_SITE_ID | |
const customerioApiKey = process.env.CUSTOMER_IO_API_KEY | |
const api = new APIClient(process.env.CUSTOMER_IO_APP_KEY, { region: RegionUS }) | |
const customerio = new TrackClient(customerioSiteId, customerioApiKey, { | |
region: RegionUS | |
}) | |
const createMail = (mailObj) => { | |
return new SendEmailRequest(mailObj) | |
} | |
const sendMail = async (request) => { | |
const response = await api.sendEmail(request) | |
return response | |
} | |
const sendMailFromObject = async (mailObj) => { | |
const response = await api.sendEmail(createMail(mailObj)) | |
return response | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment