Hello
I want to trigger a flow when a user joins the list Newsletter.
Currently the user is being added to the list Newsletter successfully with double opt in, and single opt in, but in either case, the flow is not triggering, resulting in my webhook not sending.
I can see that the user is added to the list on my dashboard, so why would the flow not trigger?
When I send this webhook as a test manually from the Klaviyo dashboard, it sends successfully to my server.
I have deleted the test user from my Newsletter list and retried several times. A double opt in email sends, I click to opt in, I am added to the Newsletter list, and still, the Flow above is not triggered. Again, single and double opt in functionality has been tested with the same result.
My code for adding a user to the Newsletter list which is successful:
...
const url = `https://a.klaviyo.com/api/v2/list/<LIST ID>/subscribe?api_key=${process.env.KLAVIYO_PRIVATE_KEY}`;
const options = {
method: 'POST',
headers: {accept: 'application/json', 'content-type': 'application/json'},
body: JSON.stringify({
profiles: o
{email: req.body.email}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
...