• Hello my dear people

    I have a problem. I know the plugin sends the mail to the admin mail stored in WP but I want the plugin to send the .pdf to another mail without changing the admin mail of wp.

    Can someone help me?

    thank you in advance

    Best regards

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author David Jensen

    (@dkjensen)

    @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.

    Thread Starter vulpez

    (@vulpez)

    perfect, thank you m8

    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!

    Plugin Author David Jensen

    (@dkjensen)

    @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…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Changing send Mail’ is closed to new replies.