• Resolved mrsandface

    (@mrsandface)


    Hi everyone,

    I was wondering if it’s possible to show the purchase note only in admin email, but remove it from customer emails?

    Best regards,

    Aeron

Viewing 8 replies - 1 through 8 (of 8 total)
  • 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

    Thread Starter mrsandface

    (@mrsandface)

    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.

    Thread Starter mrsandface

    (@mrsandface)

    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;
    }
    
    Thread Starter mrsandface

    (@mrsandface)

    Hi!

    Using this piece of code, it stops sending mail altogether 🙁

    Thread Starter mrsandface

    (@mrsandface)

    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!

    Plugin Support abwaita a11n

    (@abwaita)

    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.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Purchase Note in customer and admin e-mail’ is closed to new replies.