Option for new order/stock recipient. Closes #124.

This commit is contained in:
Mike Jolley 2011-11-01 17:11:57 +00:00
parent 91874aec5e
commit 482d7e9291
3 changed files with 27 additions and 6 deletions

View File

@ -645,7 +645,27 @@ $woocommerce_settings['tax'] = apply_filters('woocommerce_tax_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(
'name' => __( '"From" name', 'woothemes' ),

View File

@ -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
* Best sellers widget based on new total_sales field
* Ability to exclude product ids
* Option for the recipient of order/stock emails
* Edit category - image fix
* Order Complete email heading fix
* 100% discount when price excludes tax logic fix

View File

@ -110,7 +110,7 @@ function woocommerce_new_order_notification( $id ) {
$message = ob_get_clean();
// 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');
$message = '#' . $_product->id .' '. $_product->get_title() . ' ('. $_product->sku.') ' . __('is low in stock.', 'woothemes');
$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');
$message = '#' . $_product->id .' '. $_product->get_title() . ' ('. $_product->sku.') ' . __('is out of stock.', 'woothemes');
$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');
$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 );
wp_mail( get_option('admin_email'), $subject, $message );
wp_mail( get_option('woocommerce_stock_email_recipient'), $subject, $message );
}
/**