Add PDF to WooCommerce Order Email only for the admin copySend email from WooCommerce when order status is changed to a custom order statusChange WooCommerce recipient for admin emailsWoocommerce - Need to send email to specific address based on zip codeHow to detect email recipient in Woocommerce template partial?Insert action after Woocomerce Completed Order Email is sent outWooCommerce New order email manually trigger for some productsAdd an attachment to admin email-notification once order is placed in WoocommerceCustomize order item meta only for WooCommerce admin email notificationsExclude email attachments from specific email notifications in WoocommerceWoocommerce Email Alert: New Order to Store Admin, Processing Order to Customer?

What is this arch-and-tower near a road?

LTSpice: how to setup sinusoidal or exponential voltage source?

What is the highest level of accuracy in motion control a Victorian society could achieve?

Why do Klingons use cloaking devices?

Is this standard Japanese employment negotiations, or am I missing something?

How did the IEC decide to create kibibytes?

Why weren't Gemini capsules given names?

Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?

Why does mean tend be more stable in different samples than median?

Can a Time Lord survive with just one heart?

Are "confidant" and "confident" homophones?

PhD: When to quit and move on?

Why no parachutes in the Orion AA2 abort test?

Isn't "Dave's protocol" good if only the database, and not the code, is leaked?

Is it possible to spoof an IP address to an exact number?

What happens if the limit of 4 billion files was exceeded in an ext4 partition?

Why do we need a bootloader separate from our application program in microcontrollers?

Was the 45.9°C temperature in France in June 2019 the highest ever recorded in France?

How can I effectively map a multi-level dungeon?

The Purpose of "Natu"

Has there ever been a cold war other than between the U.S. and the U.S.S.R.?

How to play a D major chord lower than the open E major chord on guitar?

Advice for making/keeping shredded chicken moist?

Is conquering your neighbors to fight a greater enemy a valid strategy?



Add PDF to WooCommerce Order Email only for the admin copy


Send email from WooCommerce when order status is changed to a custom order statusChange WooCommerce recipient for admin emailsWoocommerce - Need to send email to specific address based on zip codeHow to detect email recipient in Woocommerce template partial?Insert action after Woocomerce Completed Order Email is sent outWooCommerce New order email manually trigger for some productsAdd an attachment to admin email-notification once order is placed in WoocommerceCustomize order item meta only for WooCommerce admin email notificationsExclude email attachments from specific email notifications in WoocommerceWoocommerce Email Alert: New Order to Store Admin, Processing Order to Customer?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm using the woocommerce_email_attachments hook but some reason I need to add some PDF attachment only for the admin copy of new order.



I know that I can trigger this hook only for new orders, and that's ok.



But I can't figure out how can I do this only for some specific recipients.
Is there a way to do this in this hook?



This is basically what I need:



add_filter( 'woocommerce_email_attachments', 'edit_woocommerce_attachments', 10, 3 );

function edit_woocommerce_attachments($attachments, $email_id, $email_object)

if( $email_id === 'new_order')

if($email == 'admin@email.com') $attachments[] = get_attached_file( 612 );
else return;

return $attachments;










share|improve this question






























    1















    I'm using the woocommerce_email_attachments hook but some reason I need to add some PDF attachment only for the admin copy of new order.



    I know that I can trigger this hook only for new orders, and that's ok.



    But I can't figure out how can I do this only for some specific recipients.
    Is there a way to do this in this hook?



    This is basically what I need:



    add_filter( 'woocommerce_email_attachments', 'edit_woocommerce_attachments', 10, 3 );

    function edit_woocommerce_attachments($attachments, $email_id, $email_object)

    if( $email_id === 'new_order')

    if($email == 'admin@email.com') $attachments[] = get_attached_file( 612 );
    else return;

    return $attachments;










    share|improve this question


























      1












      1








      1








      I'm using the woocommerce_email_attachments hook but some reason I need to add some PDF attachment only for the admin copy of new order.



      I know that I can trigger this hook only for new orders, and that's ok.



      But I can't figure out how can I do this only for some specific recipients.
      Is there a way to do this in this hook?



      This is basically what I need:



      add_filter( 'woocommerce_email_attachments', 'edit_woocommerce_attachments', 10, 3 );

      function edit_woocommerce_attachments($attachments, $email_id, $email_object)

      if( $email_id === 'new_order')

      if($email == 'admin@email.com') $attachments[] = get_attached_file( 612 );
      else return;

      return $attachments;










      share|improve this question
















      I'm using the woocommerce_email_attachments hook but some reason I need to add some PDF attachment only for the admin copy of new order.



      I know that I can trigger this hook only for new orders, and that's ok.



      But I can't figure out how can I do this only for some specific recipients.
      Is there a way to do this in this hook?



      This is basically what I need:



      add_filter( 'woocommerce_email_attachments', 'edit_woocommerce_attachments', 10, 3 );

      function edit_woocommerce_attachments($attachments, $email_id, $email_object)

      if( $email_id === 'new_order')

      if($email == 'admin@email.com') $attachments[] = get_attached_file( 612 );
      else return;

      return $attachments;







      wordpress woocommerce email-attachments






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 4:07









      mujuonly

      3,0691 gold badge17 silver badges37 bronze badges




      3,0691 gold badge17 silver badges37 bronze badges










      asked Mar 25 at 19:29









      AmeAme

      831 silver badge11 bronze badges




      831 silver badge11 bronze badges






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55345142%2fadd-pdf-to-woocommerce-order-email-only-for-the-admin-copy%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55345142%2fadd-pdf-to-woocommerce-order-email-only-for-the-admin-copy%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript