@vulpez
Hello
You can use the snippet below to add additional recipients to the email:
add_filter( 'wc_cart_pdf_admin_copy_email', function( $email ) {
$recipients = (array) $email;
$recipients[] = '[email protected]'; // Add additional emails here
return $recipients;
} );
You can place this in your child theme functions.php file or in a plugin.
Hello, @dkjensen !
Can I add this new email recepient dinamically and on demand?
I have a button “send e-mail with budget” in my site that must send the PDF to the custumer that just generate it (I get the custumer e-mail in a form earlier).
Is that possible via JS, PHP or Ajax?
Thanks!
@jorgehoffmann
Yes you can use the PHP filter as follows:
add_filter( 'wc_cart_pdf_admin_copy_email', function( $email ) {
return array( '[email protected]', '[email protected]' ); // String or array of emails
} );
Sorry, I don’t know where to put this code, but let me remake my question.
I have to create a function that generates and downloads the PDF, and another one that generates and send the PDF by email without downloading.
Is it possible?
Thanks.
Maybe pass a variable thru the URL that prevents from beeing downloaded, just generate and send…