I use this variable for payment method: {{ event.extra.payment_details.credit_card_company }}. It works when customer uses credit card but for Paypal it doesn’t show anything. What can I do to accommodate non-credit card payments?
How to dynamically display payment methods in an email that is not via credit card
Hello
Great question!
I would first suggest reviewing how your event is structured to passing these various form of payment methods to Klaviyo. Doing so would allow you to see the metadata that is shared and also provide you with the appropriate syntax required to pull in a different set of tags which may return your desired result of highlighting the payment method as PayPal.You can find guidance on how to find your desired variable tags along with how to utilize these event data in your email from the About Using Event Variables to Personalize Flows Help Center article with a helpful video under the How to Find Event Variables subsection.
Since it seems like the variable you are currently using of {{ event.extra.payment_details.credit_card_company }}
may be too specific for your use case of wanting to also highlight the payment method of being PayPal, I may suggest reviewing the data above this specific array item and see if the syntax will return your desired result.
Some other Community posts that may be helpful in reviewing are the ones below which touch upon a similar subject to what you were trying to accomplish:
I hope this helps!
David
Hi
In addition to
Have a nice weekend!
Julie
![Anniversary - 2 years Badge](https://uploads-us-west-2.insided.com/klaviyo-en/attachment/9c1854d8-7db8-4ea0-95f4-085af72d8496_thumb.png)
Thanks guys for your inputs! Seems like if/else logic is the way to go.
![Anniversary - 2 years Badge](https://uploads-us-west-2.insided.com/klaviyo-en/attachment/9c1854d8-7db8-4ea0-95f4-085af72d8496_thumb.png)
Additional question: what’s the correct syntax for if-else for this variable?
![](https://uploads-us-west-2.insided.com/klaviyo-en/attachment/2aab40ac-57ca-4326-aed0-e381e26af5d0.png)
Wanted the logic to be:
- If payment is shopify_payments, then show credit card company and last 4 digits
- Else, if payment is paypal, show “paid via paypal”
Thank you!
Hey
When formulating an if-else statement using event variables, you should still be able to use that exact same syntax provided in the Klaviyo preview tool. In addition to offering a great overview of creating if-else statements from dynamic event data,
Since every template and set up is different, you may also want to consult with a developer or email design expert to further assist you in creating an if-else statement that achieves your goal. If you need, you can find a number of amazing Klaviyo Partner agencies from our Agency Partner Directory.
Have a great day!
David
Reply
Log in to the Community
Use your Klaviyo credentials
Log in with Klaviyo
Use your Klaviyo credentials
Log in with KlaviyoEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.