Skip to main content
Solved

Dynamic email recipients in a flow

  • September 29, 2023
  • 2 replies
  • 127 views

Forum|alt.badge.img+1

Hello!

I am triggering an event using the /event API from my backend system any time an appointment is booked on our website. My use case is to email the person that booked an appointment (the customer) and also email the person that the customer is booking with (the provider). There is no issue sending the first email because I am setting the profile.data.id value. I am also sending the email address for the provider via the attributes.properties.providerEmail. I can’t seem to find a way to access this variable in either notifications or email. 

Here is my post body:

{
  "data": {
    "type": "event",
    "attributes": {
      "properties": {
        "providerEmail":"test@test.com",
      },
      "time": "2023-09-28T24:31:52",
      "metric": {
        "data": {
          "type": "metric",
          "attributes": {
            "name": "Booked Appointment"
          }
        }
      },
      "profile": {
        "data": {
          "type": "profile",
          "id": "1234"
        }
      }
    }
  }
}

Any Ideas on how I can send that second email dynamically to the email listed in the event’s body?

 

Thanks!

Best answer by Brian Turcotte

Hi @justinbeseen!

My apologies for the delay here! May I ask if you could provide a screenshot of the syntax you’re using in the flow email? 

 

The structure of the metric looks alright to me, so I’m guessing the issue is in the formatting of the email variable. To find the correct variable for the selected event, you can follow these instructions:

 

Best,

Brian

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

2 replies

Brian Turcotte
Forum|alt.badge.img+37

Hi @justinbeseen!
 

I’m going to check on this with Engineering and I’ll update the thread ASAP!

 

Best,

Brian


Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • November 9, 2023

Hi @justinbeseen!

My apologies for the delay here! May I ask if you could provide a screenshot of the syntax you’re using in the flow email? 

 

The structure of the metric looks alright to me, so I’m guessing the issue is in the formatting of the email variable. To find the correct variable for the selected event, you can follow these instructions:

 

Best,

Brian