How to personalize email order confirmations based on payment method?

Hi,

I need help.

Im having problems setting my email order confirmation.

I have to personalize it, depending on the payment method for example, if someone pays with Cash on Delivey is a different email that if someone pays with credit card.

I was able to “Bank Deposit” and the email comes out great, but on “Cash on delivery (COD)” it didn’t work, I dont understand why if both are in the same way.

This is how it looks:

{% for transaction in transactions %}
{% if transaction.gateway_display_name == “Bank Deposit.” %}

Puedes continuar con tu pago, depositando a la cuenta corriente del Banco XXXXXXX número: XXXXXXXX a nombre de XXXXXXX. Al finalizar por favor envíanos confirmación de pago al correo: XXXXXXXXXXXXXXXXXX.

{% endif %}
{% endfor %}

{% for transaction in transactions %}
{% if transaction.gateway_display_name == “Pago contra entrega” %}

Recibirás un correo electrónico cuando tu pedido sea enviado.

{% endif %}
{% endfor %}

I will really appreciate your help.

Thank you!!!

Carolina

1 Like

can you please give link of your store to check the valuer of the payment method and I can help you with this issues if you want

1 Like

Hi @AdamSmith12

Thank you, here is the link and password.

https://gracegarcia-design.com/

Password: hebrug

Thanks for your help.

Carolina

Hi @LaseMakers ,

You can try my solution.

Please change transaction.gateway_display_name == “Pago contra entrega” to transaction.gateway_display_name contains “Pago contra entrega”

Please let me know if you need further support after changing that. Hope this helps!

1 Like

Hi @LitExtension

Thank you so much you save my page, all it needed was to add “contains”, the weird thing is that with others pages it worked well how I had it.

Best regards.

Carolina

Hi @LaseMakers

It’s our pleasure when helping you with your issue and getting accepted as a solution.

If you need further support, just let me know and we will support you dedicatedly.

Have a great day!

Facing the same problem, but the contains solution doesn’t work on our end.

{% if transaction.gateway_display_name contains “Vorauskasse” %}

Bankdaten für Vorauskasse

livom möbel gmbh
Nordstrasse 13
8580 Amriswil

IBAN: CH73 0078 4297 4200 4200 1
BIC/Swift: KBTGCH22
Thurgauer Kantonalbank

{% else %}

tralala

{% endif %}

https://livom.ch/

I am having the same issue. Did you find a solution since your post?

This is my code. My payment method is called “Überweisung / Vorkasse” and gets displayed in lowercase sometimes from shopify. Because of that I am using the downcase filter.

{% assign zahlungsart = transaction.gateway_display_name | downcase %}
{% if zahlungsart contains ‘vorkasse’ %}

Bitte überweise den offenen Betrag an:

Gras im Glas
IBAN:
BIC:
Bank: k
Verwendungszweck: {{ order_number }}

Nach Zahlungseingang versenden wir umgehend deine Bestellung.

{% endif %}

Hi

I do have the same issue. I am looking to solve the same for “Vorkasse”. Did you solve the problem in the meantime? How must the code look like in the order confirmation template?

I really look forward to a solution

For me @LitExtension 's solution didn’t work either. But I could solve it by using simply “gateway” instead of “transaction.gateway_display_name” or “transaction.gateway”. Like this:

{% if gateway == "My custom payment method" %}

I hope this works for others too!