Hi there. We use a flow to send transactional order confirmation emails triggered by a “Placed Order” event. All good. Works perfectly. However, we regularly need to resend these emails because:
- a customer mistakenly deleted or somehow missed the email
- a customer mistyped their email address or wants a copy sent to their work address etc.
I would like to handle both cases using the “Render & Send” endpoint of the API but have run into a few problems.
- we needed to copy the flow template into the template library because flow templates aren’t available using the API. but we will forever more have to remember to keep the two in sync, which is not ideal. is there a better way?
- if the email address is different from the original, then we need to create a new Klaviyo profile and merge them. it would be nice to be able to simply edit the email address, but i understand the privacy implications of this probably make this a non-starter.
- no matter what we do, the “context” param in the render API call simply doesn’t replace the variables in the html that is returned. even the basic example provided in the docs won’t do the ticket. it seems extremely simple, but i don’t know where we might be going wrong.
- when trying to use the render & send (not just render) a 401 “Your account must be verified to perform this request” is returned. but we have already been verified. we could just use the render (if we could get it working) and send the resulting html using our own email relay, but the hope is that by using the Klaviyo api, the send would get logged to the user’s profile.
BTW, all testing has been done using the Klaviyo Postman collection which is an incredible resource. So fat-fingered typos are greatly reduced. I love it!
Any help would be appreciated.