1

How do I add the customers e-mail to the sales transaction e-mail? At the moment I include the shipping and billing details but these only include the address and telephone number. How do I add the customers email address (I can't see the variable on the admin side) - is it something I need to do in FTP?

The current setup is as follows:

  {{template config_path="design/email/header"}}
  {{inlinecss file="email-inline.css"}}

  <table cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td>
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td class="email-heading">
                    <h1>Thank you for your order from {{var store.getFrontendName()}}.</h1>
                    <p>Once your package ships we will send an email with a link to track your order. Your order summary is below. Thank you again for your business.</p>
                </td>
                <td class="store-info">
                    <h4>Order Questions?</h4>
                    <p>
                        {{depend store_phone}}
                        <b>Call Us:</b>
                        <a href="tel:{{var phone}}">{{var store_phone}}</a><br>
                        {{/depend}}
                        {{depend store_hours}}
                        <span class="no-link">{{var store_hours}}</span><br>
                        {{/depend}}
                        {{depend store_email}}
                        <b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>
                        {{/depend}}
                    </p>
                </td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td class="order-details">
        <h3>Your order <span class="no-link">#{{var order.increment_id}}</span></h3>
        <p>Placed on {{var order.getCreatedAtFormated('long')}}</p>
    </td>
</tr>
<tr class="order-information">
    <td>
        {{if order.getEmailCustomerNote()}}
        <table cellspacing="0" cellpadding="0" class="message-container">
            <tr>
                <td>{{var order.getEmailCustomerNote()}}</td>
            </tr>
        </table>
        {{/if}}
        {{layout handle="sales_email_order_items" order=$order}}
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td class="address-details">
                    <h6>Bill to:</h6>
                    <p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
                </td>
                {{depend order.getIsNotVirtual()}}
                <td class="address-details">
                    <h6>Ship to:</h6>
                    <p><span class="no-link">{{var order.getShippingAddress().format('html')}}</span></p>
                </td>
                {{/depend}}
          <td class="address-details">
                    <h6>Email:</h6>
                   <p>{{htmlescape myemail=$order.getCustomerEmail()}}</p>
           </td>
            </tr>
            <tr>
                {{depend order.getIsNotVirtual()}}
                <td class="method-info">
                    <h6>Shipping method:</h6>
                    <p>{{var order.shipping_description}}</p>
                </td>
                {{/depend}}
                <td class="method-info">
                    <h6>Payment method:</h6>
                    {{var payment_html}}
                </td>
            </tr>
        </table>
    </td>
</tr>
</table>
         {{template config_path="design/email/footer"}}
2
  • Awesome, What about the same variables but for Magento 2. That will be great. – makkomaster Aug 13 '18 at 13:56
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review – liyakat Aug 13 '18 at 14:22
2

The order emails already have access to the order object. So any field or value of an order can be accessed in the mail.

In this case that would be {{var order.customer_email}}

8

I'll leave you here several variables in case you need them:

- For registration:

{{var customer}} Will print out all customer information

{{var customer.ID}}

{{var customer.email}}

{{var customer.firstname}}

{{var customer.lastname}}

{{var customer.name}}

{{var customer.password}}

{{var customer.created_in}} Store Name

{{var customer.dob}} Date of Birth

{{var customer.password_hash}}

{{var customer.prefix}}

{{var customer.middlename}} Initial

{{var customer.suffix}}

{{var customer.group_id}}

{{var customer.taxvat}}

{{var customer.store.name}} What store they registered with (On Demo store this will display as ‘English’

{{var customer.store.group.name}} The actual Store’s name (not the Store View’s)

- To subscribe/unsubscribe newsletter:

{{var subscriber.getConfirmationLink()}}

{{var subscriber.getUnsubscriptionLink()}}

{{var subscriber.email}}

- Send to a friend:

{{var product_image}}

{{var name}} Recipient’s Name

{{var email}} Recipient’s Email

{{var product_name}} Product Name

{{var product_url}} Product Url

{{var message}} Message Text

{{var sender_name}} Sender’s Name

{{var sender_email}} Sender’s Email

{{var product_image}} Product Image

- Block

{{block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order}}

- Depend Condition

{{depend order.getIsNotVirtual()}}

{{/depend}}

{{depend salable}}

{{/depend}}

- If Condition

{{if order.getIsNotVirtual()}}

{{else}}

{{/if}}

(else is optional)

- Skin

{{skin url="'}}

- Store

{{store url=""}}

- New order : Shipping Address

{{var order.getShippingAddress().format('html')}}

Items of the shipping address :

{{var order.getShippingAddress().getName()}} Get the first and last name

{{var order.getShippingAddress().getPrefix()}}

{{var order.getShippingAddress().getFirstName()}}

{{var order.getShippingAddress().getMiddleName()}}

{{var order.getShippingAddress().getLastName()}}

{{var order.getShippingAddress().getSuffix()}}

{{var order.getShippingAddress().getStreet1()}}

{{var order.getShippingAddress().getStreet2()}}

{{var order.getShippingAddress().getCity()}}

{{var order.getShippingAddress().getRegion()}}

{{var order.getShippingAddress().getPostcode()}}

{{var order.getShippingAddress().getCountry()}} Get the country’s ID

{{var order.getShippingAddress().getCountryModel().getName()}} Get the country’s full name

{{var order.getShippingAddress().getRegion()}}

{{var order.getShippingAddress().getTelephone()}}

- Other

{{var addAllLink}}

{{var alertGrid}}

{{var billingAddress.format('html')}}

{{var checkoutType}}

{{var comment}}

{{var creditmemo.id}}

{{var creditmemo.increment_id}}

{{var data.comment}}

{{var data.email}}

{{var data.name}}

{{var data.telephone}}

{{var dateAndTime}}

{{var invoice.id}}

{{var invoice.increment_id}}

{{var invoice.created_at}}

{{var items}}

{{var items_html}}

{{var message}}

{{var name}}

{{var order.customer_email}}

{{var order.getBillingAddress().format('html')}}

{{var order.getBillingAddress().getName()}}

{{var order.getCreatedAtFormated('long')}}

{{var order.getCustomerName()}}

{{var order.getCustomerFirstname()}}

{{var order.getCustomerLastname()}}

{{var order.getEmailCustomerNote()}} Currently unknwon how to test this variable for being set/empty

{{var order.getShippingDescription()}}

{{var order.getStatusLabel()}}

{{var order.getStoreGroupName()}}

{{var order.id}}

{{var order.increment_id}}

{{var password}}

{{var payment_html}}

{{var paymentMethod}}

{{var product_name}}

{{var product_url}}

{{var reason}} Reason for payment failure

{{var shipment.increment_id}}

{{var shippingAddress.format('html')}}

{{var shippingMethod}}

{{var total}}

{{var user.name}}

{{var viewOnSiteLink}}

{{var warnings}}

{{var billing.name}}
0

I tried every option which I found here, but nothing worked. After some research I found customer email in billing variable {{var billing.email}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.