Option for new order/stock recipient. Closes #124.
This commit is contained in:
parent
91874aec5e
commit
482d7e9291
|
@ -644,8 +644,28 @@ $woocommerce_settings['tax'] = apply_filters('woocommerce_tax_settings', array(
|
||||||
)); // End tax settings
|
)); // End tax settings
|
||||||
|
|
||||||
$woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', array(
|
$woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', array(
|
||||||
|
|
||||||
array( 'name' => __( 'Email Options', 'woothemes' ), 'type' => 'title', '', 'id' => 'email_options' ),
|
array( 'name' => __( 'Email Recipient Options', 'woothemes' ), 'type' => 'title', '', 'id' => 'email_recipient_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'name' => __( 'New order notifications', 'woothemes' ),
|
||||||
|
'desc' => __( 'The recipient of new order emails. Defaults to the admin email.', 'woothemes' ),
|
||||||
|
'id' => 'woocommerce_new_order_email_recipient',
|
||||||
|
'type' => 'text',
|
||||||
|
'std' => esc_attr(get_option('admin_email'))
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'name' => __( 'Inventory notifications', 'woothemes' ),
|
||||||
|
'desc' => __( 'The recipient of stock emails. Defaults to the admin email.', 'woothemes' ),
|
||||||
|
'id' => 'woocommerce_stock_email_recipient',
|
||||||
|
'type' => 'text',
|
||||||
|
'std' => esc_attr(get_option('admin_email'))
|
||||||
|
),
|
||||||
|
|
||||||
|
array( 'type' => 'sectionend', 'id' => 'email_recipient_options' ),
|
||||||
|
|
||||||
|
array( 'name' => __( 'Email Sender Options', 'woothemes' ), 'type' => 'title', '', 'id' => 'email_options' ),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'name' => __( '"From" name', 'woothemes' ),
|
'name' => __( '"From" name', 'woothemes' ),
|
||||||
|
|
|
@ -94,6 +94,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
|
||||||
* Custom field for product total_sales when sold
|
* Custom field for product total_sales when sold
|
||||||
* Best sellers widget based on new total_sales field
|
* Best sellers widget based on new total_sales field
|
||||||
* Ability to exclude product ids
|
* Ability to exclude product ids
|
||||||
|
* Option for the recipient of order/stock emails
|
||||||
* Edit category - image fix
|
* Edit category - image fix
|
||||||
* Order Complete email heading fix
|
* Order Complete email heading fix
|
||||||
* 100% discount when price excludes tax logic fix
|
* 100% discount when price excludes tax logic fix
|
||||||
|
|
|
@ -110,7 +110,7 @@ function woocommerce_new_order_notification( $id ) {
|
||||||
$message = ob_get_clean();
|
$message = ob_get_clean();
|
||||||
|
|
||||||
// Send the mail
|
// Send the mail
|
||||||
woocommerce_mail( get_option('admin_email'), $subject, $message );
|
woocommerce_mail( get_option('woocommerce_new_order_email_recipient'), $subject, $message );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ function woocommerce_low_stock_notification( $product ) {
|
||||||
$subject = '[' . get_bloginfo('name') . '] ' . __('Product low in stock', 'woothemes');
|
$subject = '[' . get_bloginfo('name') . '] ' . __('Product low in stock', 'woothemes');
|
||||||
$message = '#' . $_product->id .' '. $_product->get_title() . ' ('. $_product->sku.') ' . __('is low in stock.', 'woothemes');
|
$message = '#' . $_product->id .' '. $_product->get_title() . ' ('. $_product->sku.') ' . __('is low in stock.', 'woothemes');
|
||||||
$message = wordwrap( html_entity_decode( strip_tags( $message ) ), 70 );
|
$message = wordwrap( html_entity_decode( strip_tags( $message ) ), 70 );
|
||||||
wp_mail( get_option('admin_email'), $subject, $message );
|
wp_mail( get_option('woocommerce_stock_email_recipient'), $subject, $message );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ function woocommerce_no_stock_notification( $product ) {
|
||||||
$subject = '[' . get_bloginfo('name') . '] ' . __('Product out of stock', 'woothemes');
|
$subject = '[' . get_bloginfo('name') . '] ' . __('Product out of stock', 'woothemes');
|
||||||
$message = '#' . $_product->id .' '. $_product->get_title() . ' ('. $_product->sku.') ' . __('is out of stock.', 'woothemes');
|
$message = '#' . $_product->id .' '. $_product->get_title() . ' ('. $_product->sku.') ' . __('is out of stock.', 'woothemes');
|
||||||
$message = wordwrap( html_entity_decode( strip_tags( $message ) ), 70 );
|
$message = wordwrap( html_entity_decode( strip_tags( $message ) ), 70 );
|
||||||
wp_mail( get_option('admin_email'), $subject, $message );
|
wp_mail( get_option('woocommerce_stock_email_recipient'), $subject, $message );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ function woocommerce_product_on_backorder_notification( $product, $amount ) {
|
||||||
$subject = '[' . get_bloginfo('name') . '] ' . __('Product Backorder', 'woothemes');
|
$subject = '[' . get_bloginfo('name') . '] ' . __('Product Backorder', 'woothemes');
|
||||||
$message = $amount . __(' units of #', 'woothemes') . $_product->id .' '. $_product->get_title() . ' ('. $_product->sku.') ' . __('have been backordered.', 'woothemes');
|
$message = $amount . __(' units of #', 'woothemes') . $_product->id .' '. $_product->get_title() . ' ('. $_product->sku.') ' . __('have been backordered.', 'woothemes');
|
||||||
$message = wordwrap( html_entity_decode( strip_tags( $message ) ), 70 );
|
$message = wordwrap( html_entity_decode( strip_tags( $message ) ), 70 );
|
||||||
wp_mail( get_option('admin_email'), $subject, $message );
|
wp_mail( get_option('woocommerce_stock_email_recipient'), $subject, $message );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue