Skip to main content
Solved

Is there any possibility that we can get dynamic data from database before sending emails


Forum|alt.badge.img+2

Let me explain with an example, we have car prices on our website for which price is changed based on the change in the currency rates. We have built our website on Laravel. We want our products with a custom catalog, this would be the prices and images etc work smoothly in our Automation system. 

Can custom api events fetch data from our website right? 

Any other possible solution of this.

Best answer by retention

Adding on to what ​@Byrne C mentioned, your scenario sounds like its best suited for a custom catalog.  If you have multiple currencies, you can have one for each currency, and have a routine that updates the prices based on a daily currency rate change for all currencies you support.  There are a few required fields for the Custom Catalog (product ID, name, price, inventory, etc) - but you can also add addition fields that might be necessary for your templates (e.g. color, material, SKU, etc).  

Syncing a custom catalog is documented here:

 

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

4 replies

talhahussain
Problem Solver IV
Forum|alt.badge.img+8
  • Problem Solver IV
  • 76 replies
  • February 5, 2025

Yes, you can dynamically fetch data from your database before sending emails in Klaviyo. This is achievable by integrating your external data with Klaviyo through custom properties, events, or web feeds. Here's how:

1. Custom Properties and Events:

  • Custom Properties: Store dynamic data as custom properties on a user's profile. For instance, if you have a loyalty program, you can update each user's profile with their current points.
  • Events: Send custom events to Klaviyo with the relevant data. For example, when a user performs a specific action, you can trigger an event that includes dynamic information.

Implementation Steps:

  • Update Profiles: Use Klaviyo's API to update user profiles with custom properties.
  • Trigger Events: Send events to Klaviyo using the Track API, including the dynamic data as event properties.

By following this approach, you can ensure that your emails contain the most up-to-date and personalized information for each recipient.

For a visual guide on adding dynamic content to Klaviyo emails, you might find this tutorial helpful:
https://youtu.be/AlJFxnewKvk


hani
Contributor I
  • 2025 Champion
  • 2 replies
  • February 5, 2025

Talha is correct above, you can dynamically send the data to the profile to be used in your flows. The alternative (if you have Klaviyo CDP) is the code block - https://help.klaviyo.com/hc/en-us/articles/18620644491035

 

The code block allows you to reach out to API’s in the middle of your flow to bring in data that can be used to branch, personalise and inform things downstream


Byrne C
Community Manager
Forum|alt.badge.img+10
  • Community Manager
  • 71 replies
  • February 6, 2025

Hi ​@G Mustafa 

Are you trying to display prices of items in your catalog that consistently change? If so, I’d recommend using catalog lookup tags. These tags will allow you to pull information about items in your catalog and display it in your emails. This guide here goes into more detail on how to do this.

For example, this tag would display the price of an item in your catalog that constantly changes.

{% catalog itemID unpublished="cancel" %}{% currency_format catalog_item.metadata|lookup:"price" %}
{% endcatalog %}

Also, do you already have a custom catalog, or are you looking to set one up? Let me know if I can explain this in further detail, or if you have any additional questions regarding this!

-Byrne


retention
Partner - Platinum
Forum|alt.badge.img+62
  • 2025 Champion
  • 920 replies
  • Answer
  • February 6, 2025

Adding on to what ​@Byrne C mentioned, your scenario sounds like its best suited for a custom catalog.  If you have multiple currencies, you can have one for each currency, and have a routine that updates the prices based on a daily currency rate change for all currencies you support.  There are a few required fields for the Custom Catalog (product ID, name, price, inventory, etc) - but you can also add addition fields that might be necessary for your templates (e.g. color, material, SKU, etc).  

Syncing a custom catalog is documented here: