Order confirmation email - content based on payment type

Solved

Order confirmation email - content based on payment type

ElliottF
Shopify Partner
7 0 1

Hello,

I'm wanting to change a line of text based on what payment method was used? I have a custom payment option which I want to identify.

Is there a simple way of doing this please?

Thanks!

Accepted Solutions (2)
MarcoReleasit
Shopify Partner
314 24 64

This is an accepted solution.

Hi @ElliottF 

You can use this pieace of code in your email templates to add custom text or HTML for a specific payment method:

{% assign _is_my_payment_method = false %}
{% for transaction in transactions %}
   {% if transaction.gateway == '{YOUR PAYMENT METHOD NAME HERE}' %}
      {% assign _is_my_payment_method = true%}
   {% endif%}
{% endfor %}

{% if _is_my_payment_method == true %}
  {INSERT HERE YOUR CUSTOM HTML FOR THE PAYMENT METHOD}
{% endif %}

 

Hope this helps!

 

Install Releasit Cash On Delivery for free here: https://apps.shopify.com/cash-on-delivery-fee
Add a fee to Cash on Delivery and limit COD based on any condition (order total, location, products, collections, etc.)

View solution in original post

MarcoReleasit
Shopify Partner
314 24 64

This is an accepted solution.

Hello @LaseMakers 

In your specific case if you want to show a message for Bank Deposit here's the snippet code that you sent me with my code in it:

{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
{% case delivery_method %}
{% when 'pick-up' %}
You’ll receive an email when your order is ready for pickup.
{% when 'local' %}
Hi {{ customer.first_name }}, we're getting your order ready for delivery.

{% else %}
Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
{% endcase %}
{%- assign _is_my_payment_method = false -%}
{%- for transaction in transactions -%}
   {% if transaction.gateway == 'Bank Deposit' %}
      {% assign _is_my_payment_method = true%}
   {% endif%}
{%- endfor -%}
{% if _is_my_payment_method == true %}
  <p>{INSERT HERE YOUR CUSTOM HTML FOR THE PAYMENT METHOD}</p>
{% endif %}
{% if delivery_instructions != blank %}
<p><b>Delivery information:</b> {{ delivery_instructions }}</p>
{% endif %}
{% endif %}
{% endcapture %}

You can add your custom message by replacing the "{INSERT HERE YOUR CUSTOM HTML FOR THE PAYMENT METHOD}" string!

Hope this helps!

Marco

Install Releasit Cash On Delivery for free here: https://apps.shopify.com/cash-on-delivery-fee
Add a fee to Cash on Delivery and limit COD based on any condition (order total, location, products, collections, etc.)

View solution in original post

Replies 6 (6)

Bloom_Property
Shopify Partner
1 0 0

Hi ,

I understand you want to make changes on your Order confirmation email?

You can type something like this on the email body where you want to show the line of text:

{% for transaction in transactions %}
   {% if transaction.gateway_display_name == 'Cash on Delivery (COD)' %}

       //type line of text

   {% else %}

       //type line of text

   {% endif%}
{% endfor %}

In this example, the payment method used is Cash on Delivery (COD).

MarcoReleasit
Shopify Partner
314 24 64

This is an accepted solution.

Hi @ElliottF 

You can use this pieace of code in your email templates to add custom text or HTML for a specific payment method:

{% assign _is_my_payment_method = false %}
{% for transaction in transactions %}
   {% if transaction.gateway == '{YOUR PAYMENT METHOD NAME HERE}' %}
      {% assign _is_my_payment_method = true%}
   {% endif%}
{% endfor %}

{% if _is_my_payment_method == true %}
  {INSERT HERE YOUR CUSTOM HTML FOR THE PAYMENT METHOD}
{% endif %}

 

Hope this helps!

 

Install Releasit Cash On Delivery for free here: https://apps.shopify.com/cash-on-delivery-fee
Add a fee to Cash on Delivery and limit COD based on any condition (order total, location, products, collections, etc.)
LaseMakers
Shopify Partner
101 1 28

Hi!! @MarcoReleasit 

I also need to change order confirmation email, depending on the payment method.

My payment method are:

Tarjeta de Crédito 

Bank Deposit 

I inserted your code, but it did not work for, where exactly should it go?

Code:

{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
{% case delivery_method %}
{% when 'pick-up' %}
You’ll receive an email when your order is ready for pickup.
{% when 'local' %}
Hi {{ customer.first_name }}, we're getting your order ready for delivery.

{% else %}
Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
{% endcase %}
{% if delivery_instructions != blank %}
<p><b>Delivery information:</b> {{ delivery_instructions }}</p>
{% endif %}
{% endif %}
{% endcapture %}

 

Thank you!!

 

Carolina 

MarcoReleasit
Shopify Partner
314 24 64

This is an accepted solution.

Hello @LaseMakers 

In your specific case if you want to show a message for Bank Deposit here's the snippet code that you sent me with my code in it:

{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
{% case delivery_method %}
{% when 'pick-up' %}
You’ll receive an email when your order is ready for pickup.
{% when 'local' %}
Hi {{ customer.first_name }}, we're getting your order ready for delivery.

{% else %}
Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
{% endcase %}
{%- assign _is_my_payment_method = false -%}
{%- for transaction in transactions -%}
   {% if transaction.gateway == 'Bank Deposit' %}
      {% assign _is_my_payment_method = true%}
   {% endif%}
{%- endfor -%}
{% if _is_my_payment_method == true %}
  <p>{INSERT HERE YOUR CUSTOM HTML FOR THE PAYMENT METHOD}</p>
{% endif %}
{% if delivery_instructions != blank %}
<p><b>Delivery information:</b> {{ delivery_instructions }}</p>
{% endif %}
{% endif %}
{% endcapture %}

You can add your custom message by replacing the "{INSERT HERE YOUR CUSTOM HTML FOR THE PAYMENT METHOD}" string!

Hope this helps!

Marco

Install Releasit Cash On Delivery for free here: https://apps.shopify.com/cash-on-delivery-fee
Add a fee to Cash on Delivery and limit COD based on any condition (order total, location, products, collections, etc.)
andreasekman
New Member
4 0 0

Thank you for this Marco,

But not sure it this will solve what I want to do.
So example in the email for that row:

Payment method: XXXXXX

Where the "XXXXXX" i want to replace with a snippet that shows the selected payment method the payment step in the checkout.
So if I choose "Klarna" it should say:
Payment method: Klarna

Is this possible to catch with a snippet?
I have the Shopify Payments activated and also PayPal.

lenafuchs
Shopify Partner
12 0 0

Hi,

did you ever figure out how do do this?