Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Last active June 8, 2020 17:24
Show Gist options
  • Select an option

  • Save mikejolley/1926284 to your computer and use it in GitHub Desktop.

Select an option

Save mikejolley/1926284 to your computer and use it in GitHub Desktop.

Revisions

  1. mikejolley revised this gist Apr 4, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    *
    * Subject filters:
    * woocommerce_email_subject_new_order
    * woocommerce_email_subject_customer_procesing_order
    * woocommerce_email_subject_customer_processing_order
    * woocommerce_email_subject_customer_completed_order
    * woocommerce_email_subject_customer_invoice
    * woocommerce_email_subject_customer_note
  2. mikejolley revised this gist Sep 3, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@
    * woocommerce_email_subject_no_stock
    * woocommerce_email_subject_backorder
    * woocommerce_email_subject_customer_new_account
    * woocommerce_email_subject_customer_invoice_paid
    **/
    add_filter('woocommerce_email_subject_new_order', 'change_admin_email_subject', 1, 2);

  3. mikejolley created this gist Feb 27, 2012.
    25 changes: 25 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    /*
    * goes in theme functions.php or a custom plugin
    *
    * Subject filters:
    * woocommerce_email_subject_new_order
    * woocommerce_email_subject_customer_procesing_order
    * woocommerce_email_subject_customer_completed_order
    * woocommerce_email_subject_customer_invoice
    * woocommerce_email_subject_customer_note
    * woocommerce_email_subject_low_stock
    * woocommerce_email_subject_no_stock
    * woocommerce_email_subject_backorder
    * woocommerce_email_subject_customer_new_account
    **/
    add_filter('woocommerce_email_subject_new_order', 'change_admin_email_subject', 1, 2);

    function change_admin_email_subject( $subject, $order ) {
    global $woocommerce;

    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

    $subject = sprintf( '[%s] New Customer Order (# %s) from Name %s %s', $blogname, $order->id, $order->billing_first_name, $order->billing_last_name );

    return $subject;
    }