Title: How change from_email via function.php?
Last modified: August 31, 2016

---

# How change from_email via function.php?

 *  Resolved [berkelmudez](https://wordpress.org/support/users/berkelmudez/)
 * (@berkelmudez)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/how-change-from_email-via-functionphp/)
 * Hi,
 * I need to change the from_email since it’s not supposed to come from the same
   email I use as admin.
 * In the file ‘class-mailtpl.php’ I changed the mail manually like so:
 *     ```
       public static function defaults() {
       		return apply_filters( 'mailtpl/defaults_opts', array(
       			'from_name'         => get_bloginfo('name'),
       			'from_email'        => 'noreply@mywebsite.com',//get_bloginfo('admin_email')
                       ));
       }
       ```
   
 * Now it send from the email I want it to send from.
    But I know this is the wrong
   way to do it, as it’ll get overwritten once it updates. So my question is how
   to do it from the functions.php with a filter or something? I don’t know how 
   to achieve this with hooks or filters or any other proper way.
 * [https://wordpress.org/plugins/email-templates/](https://wordpress.org/plugins/email-templates/)

Viewing 1 replies (of 1 total)

 *  [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/how-change-from_email-via-functionphp/#post-7236075)
 * First you can change this directly on the customizer on the settings panel. If
   you need to use a filter simple use the one on that function like this:
 *     ```
       add_filter( 'mailtpl/defaults_opts' , 'mailtpl_custom_from_name');
       function mailtpl_custom_from_name( $opts ) {
           $opts['from_email'] = 'noreply@mywebsite.com';
   
           return $opts;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘How change from_email via function.php?’ is closed to new replies.

 * ![](https://ps.w.org/email-templates/assets/icon-256x256.gif?rev=2891165)
 * [Email Templates Customizer and Designer for WordPress and WooCommerce](https://wordpress.org/plugins/email-templates/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-templates/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-templates/)
 * [Active Topics](https://wordpress.org/support/plugin/email-templates/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-templates/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-templates/reviews/)

## Tags

 * [email from](https://wordpress.org/support/topic-tag/email-from/)

 * 1 reply
 * 2 participants
 * Last reply from: [Damian](https://wordpress.org/support/users/timersys/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/how-change-from_email-via-functionphp/#post-7236075)
 * Status: resolved