Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WooCommerce Cookbook

You're reading from   WooCommerce Cookbook WooCommerce makes it easy to create, design, and manage your own personalized eCommerce store - this WooCommerce tutorial eBook will show you how to get started

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher Packt
ISBN-13 9781784394059
Length 248 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Patrick Rauland Patrick Rauland
Author Profile Icon Patrick Rauland
Patrick Rauland
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. WooCommerce Basics FREE CHAPTER 2. Adding Products 3. Changing the Product Organization 4. Running a Membership Site 5. Setting Up Shipping Methods 6. Getting Paid 7. Modifying the Checkout Process 8. Managing Orders and Taxes 9. WooCommerce Theming 10. Exploring More with WooCommerce Index

Changing the default e-mail's from address

When you create your store, WooCommerce automatically uses the admin e-mail in WordPress as the default from address in e-mails. This is convenient for many users, but, you may want your site admin to only get admin e-mails and for someone else to get responses from customers. This can be done using one of the many WordPress hooks.

How to do it...

We'll need to add a little bit of code to modify the from address, by performing the following steps:

  1. Open up your theme's functions.php file or a custom WooCommerce plugin.
  2. At the bottom of the file, add the following code:
    add_filter( 'wp_mail_from', 'woocommerce_cookbook_wp_mail_from', 99 );

    This code tells WordPress that we want to change the standard from address in any e-mails sent. Now we need to actually write the function to do that.

  3. Add the following code beneath the preceding code:
    function woocommerce_cookbook_wp_mail_from() { 
        return html_entity_decode( &apos...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime