[Drupal] How to override the default Drupal Ubercart admin and customer mail template?

By | 26th Jun 2013 | 1 min read

When we were working on a Drupal website using Ubercart, we wanted to override the text content of the default email sent out by Ubercart. Drupal does not give us a configurational method to implement this. If you do not know how to override the default email sent out by Ubercart during checkout, continue reading.

Ubercart stores the default content for email in template files. These templates can be found inside the ubercart/uc_orders/templates folder. Ubercart uses three template files.

  1. uc_order.tpl.php - Common template file
  2. uc_order-admin.tpl.php - Template file email sent out for admin
  3. uc_order-customer.tpl.php - Template file email sent out for customer

We need to copy the template file into our themes folder to override it. However Drupal developers often forget to copy the uc_order.tpl.php file and instead focusses on just the template file they need. The trick is that you must copy both the uc_order.tpl.php file and uc_order-customer.tpl.php for overriding the customer email template and the same goes for the admin template file.Hope this helps!!