Skip to content

Instantly share code, notes, and snippets.

@birinder-lobana
Last active April 19, 2022 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save birinder-lobana/d8a250003b2cd40e8cc395106760602f to your computer and use it in GitHub Desktop.
Save birinder-lobana/d8a250003b2cd40e8cc395106760602f to your computer and use it in GitHub Desktop.
// create contact in Openscreen
await os.project(process.env.OS_PROJECT_ID).contacts().create({
firstName,
lastName,
emailAddress,
cellPhone,
consent,
})
// add profile to list in Klaviyo
await axios.post(
`https://a.klaviyo.com/api/v2/list/${process.env.KLAVIYO_LIST_ID}/subscribe?api_key=${process.env.KLAVIYO_PRIVATE_KEY}`,
{
profiles: [
{
$first_name: firstName,
$last_name: lastName,
email: emailAddress,
phone_number: cellPhone,
sms_consent: consent,
},
],
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment