Hi @mrsandface,
To make sure we’re talking about the same thing, can you send over a screenshot of an email with the note you’re looking to remove?
Thanks
Hi,
See https://ibb.co/Synzfk0
This one is what the customer receives. The admin doesn’t get the Purchase Notes. I’d like it to be reversed. The admin getting the purchase notes while the customer doesn’t. With this piece of code, both receives the mail:
add_filter (‘woocommerce_email_order_items_args’, ‘send_purchase_note_to_everyone’);
function send_purchase_note_to_everyone( $args ) {
$args[‘show_purchase_note’] = true;
return $args;
}
But I don’t want the customer to get it.
Thanks!
Hi @mrsandface,
Thanks for that. You might try modifying the snippet like this to check and see if this is an admin email or not:
if ( $args['sent_to_admin'] ) {
$args['show_purchase_note'] = true;
}
return $args;
See if that works for you.
Hi,
I’m not very technical. Where do I put this piece of code?
Hi @mrsandface,
No problem. I haven’t tested this, but it could be like this:
add_filter ('woocommerce_email_order_items_args', 'send_purchase_note_to_everyone');
function send_purchase_note_to_everyone( $args ) {
if ( $args['sent_to_admin'] ) {
$args['show_purchase_note'] = true;
}
return $args;
}
Hi!
Using this piece of code, it stops sending mail altogether 🙁
Wauw, I think it works now!
I rewrote it to:
function send_purchase_note_to_everyone( $args ) {
if ( $args['sent_to_admin'] ) {
$args['show_purchase_note'] = true;
return $args;
}
else {
$args['show_purchase_note'] = false;
return $args;
}
}
Thanks a lot!
Glad to hear you got it to work – thanks for letting us know!
I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.