Emergency situation

In case of emergencies or breakdowns, you can send an SMS to our emergency hotline

On-call phone (SMS only)

+45 29 70 15 95

Send an SMS with the following information:

  • Your name and webshop
  • Description of the problem
  • Your callback phone number

Notes: This service is only for critical situations where your webshop is down or has serious problems. For regular support, please use our normal support channels.

Customize emails based on shipping method

Guide to display different content in your emails depending on the shipping method - e.g. shipping vs. pickup.

Reading time: approx. {eight} minutes
Developer

In Shoporama, you have various templates for your transactional emails. Sometimes it makes sense to customize the email text based on the shipping method the customer has chosen—for example, if the customer has selected “in-store pickup” instead of delivery.

Why customize emails based on the shipping method?

Imagine a customer has selected “In-Store Pickup” as the shipping method. When you mark the order as shipped, the customer receives an email saying “Your order has now been shipped.” But that doesn’t make sense—the customer has to pick up the order themselves.

By customizing the email, you can instead write “Your order is ready for pickup” to customers who have chosen pickup, and keep the standard text for other shipping methods.

1. Find the shipping method’s ID

First, you need to find the ID of the shipping method you want to target. Do the following:

  1. Go to StoreShippingShipping Methods
  2. Click Edit next to the shipping option you want to work with
  3. Look at the URL in your browser—it ends with a number, e.g., /shipping/edit/7664
  4. Write down this number—it’s the shipping method’s ID

2. Customize the email template

Now you need to edit the relevant email template. For the “order shipped” email, this is the file order_sent.html in your theme.

Kodeeditoren i Shoporama-admin med mailskabelonen invoice.html aaben i temaet MBN-Delaware og fillisten med temaets templates til venstre
Email templates are edited in the Code Editor under Theme. Here, invoice.html is open, where you can insert if statements that vary the text based on the customer’s shipping method.

Insert an if statement that checks the shipping method’s ID:

<{if $order}>
  <{$shipping = $order->getShipping()}>
  <{if $shipping->getShippingId() == 7664}>
    <p>Your order is ready for pickup!</p>
    <p>Stop by the store during our business hours.</p>
  <{else}>
    <p>Your order has been shipped!</p>
    <p>You’ll receive a tracking email shortly.</p>
  <{/if}>
<{/if}>

Important

Remember to replace 7664 with the ID you found in step 1. You can add more `elseif` blocks if you have multiple shipping methods with different messages.

3. Available Variables in Email Templates

In email templates, you have access to the order and all its data. Here are the most useful ones:

Variable Description
$orderThe order object
$order->getShipping()The shipping method for the order
$shipping->getShippingId()The shipping method's ID
$shipping->getName()The shipping method's name (e.g., "PostNord")
$order->getTrackingNumber()The tracking number

4. Examples of Advanced Customization

You can also use the shipping method’s name instead of the ID, if you prefer:

<{$shipping = $order->getShipping()}>
<{if $shipping->getName()|strstr:'pickup'}>
  <p>Your order is ready for pickup</p>
<{elseif $shipping->getName()|strstr:'pakkeshop'}>
  <p>Your order has been sent to your selected pickup location</p>
<{else}>
  <p>Your order has been shipped via <{$shipping->getName()}></p>
<{/if}>

Tip

You can customize all email templates this way—not just order_sent.html. For example, you can also customize the order confirmation (invoice.html) with shipping information based on the shipping method.

How to edit the email templates

The email templates are located in your theme’s templates/mails/ folder. You can edit them via:

  • Theme Editor — directly in the Shoporama admin under Themes
  • SFTP — download and edit in your preferred program (requires a Pro subscription)

Need help customizing your emails? Contact us at support@shoporama.dk.