Add custom content to a specific customer email

You can add extra text to an email with this code snippet. You may want to include an extra thank you message, or offer a discount coupon code for returning customers. In this example we are turning the “order completed” email into a legal tax invoice by adding the required extra information at the top.

To target a specific email use one of these conditions:

 if ( $email->id == 'customer_processing_order' ) {}
 if ( $email->id == 'cancelled_order' ) {}
 if ( $email->id == 'customer_completed_order' ) {}
 if ( $email->id == 'customer_invoice' ) {}
 if ( $email->id == 'customer_new_account' ) {}
 if ( $email->id == 'customer_note' ) {}
 if ( $email->id == 'customer_on_hold_order' ) {}
 if ( $email->id == 'customer_refunded_order' ) {}
 if ( $email->id == 'customer_reset_password' ) {}
 if ( $email->id == 'failed_order' ) {}
 if ( $email->id == 'new_order' ) {}