Skip to main content
Solved

JSON to pass subject of previous email in the flow

  • December 20, 2024
  • 1 reply
  • 12 views

Forum|alt.badge.img

I have a Flow which sends out several emails throughout a 5 - 6 week period. 

After each “Send Email” event I need to pass some JSOM code to a webhook into our backend CRM (bespoke) system 

The below is the JSON, but I cannot locate or push the Email Subject or Email Body. 

{
    "KlaviyoID": "{{ person.KlaviyoID }}",
    "idPatient": "{{ person.id }}",
    "first_name": "{{ person.first_name }}",
    "last_name": "{{ person.last_name }}",
    "email": "{{ person.email }}",
    "phone_number": "{{ person.phone_number }}",
    "email_subject": "{{email.subject}}",
    "email_body": "{{ email.body }}",

    "lead_source": "Brochure Signup",
    "process": "subscribe"
}

Best answer by MANSIR2094

Hi Auser,

The issue you're experiencing likely stems from Klaviyo's inability to directly pull email_subject and email_body in the JSON payload. Unfortunately, these fields aren't natively supported for webhook payloads in Klaviyo.

Workaround:
You can include placeholders in your email content to capture the subject and body dynamically. However, if you need the exact email subject and body passed to your backend CRM, you'll need to:

  1. Use Klaviyo's API to fetch email data (e.g., email templates).
  2. Send the data to your backend CRM using a script or middleware to process and pass along the required details.

If this seems complex or you would like help setting it up step-by-step, feel free to reach out. I can simplify the process and assist in implementing it!

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

MANSIR2094
Problem Solver IV
Forum|alt.badge.img+13
  • Problem Solver IV
  • 176 replies
  • Answer
  • December 20, 2024

Hi Auser,

The issue you're experiencing likely stems from Klaviyo's inability to directly pull email_subject and email_body in the JSON payload. Unfortunately, these fields aren't natively supported for webhook payloads in Klaviyo.

Workaround:
You can include placeholders in your email content to capture the subject and body dynamically. However, if you need the exact email subject and body passed to your backend CRM, you'll need to:

  1. Use Klaviyo's API to fetch email data (e.g., email templates).
  2. Send the data to your backend CRM using a script or middleware to process and pass along the required details.

If this seems complex or you would like help setting it up step-by-step, feel free to reach out. I can simplify the process and assist in implementing it!