Create tailored marketing emails from purchase and feedback data, then decide if a coupon should be included to win back unhappy customers. Ideal for marketing teams that want fast, human sounding email copy with simple privacy controls. The flow uses AI to write the headline and body, and uses a clear check to avoid empty or broken emails.
The run starts with a manual trigger. Sample data is downloaded and read from an xls file. Campaign options are set so the AI follows your tone and goal. A LangChain Information Extractor with an OpenAI Chat Model generates the headline, the email text, and a Yes or No coupon choice without sending personal data in the prompt. Results are merged with the source row and validated. If anything is missing, the error path stops the send. A branch picks the right HTML template based on the coupon decision. A fake coupon code is added for testing or replaced with your real system. The final email is built and sent over SMTP.
You only need an OpenAI API key and an SMTP server. Map your data columns to match Item Purchased and Feedback, adjust campaign options, and customize both HTML templates. Expect less manual writing time and more consistent recovery messages. Useful for post purchase follow ups, service recovery, and targeted win back campaigns.