Title: Filter for email content?
Last modified: July 12, 2021

---

# Filter for email content?

 *  Resolved [Jim](https://wordpress.org/support/users/jwmc/)
 * (@jwmc)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/filter-for-email-content/)
 * Is there a filter for the content of an email?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Julian](https://wordpress.org/support/users/juliangk/)
 * (@juliangk)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/filter-for-email-content/#post-14654454)
 * Hello Jim,
 * could you explain in more detail what you are trying to accomplish? The plugin
   does not change content, it only applies styling. To change the content, you 
   have to change whatever is triggering the e-mails.
 * Best regards
    Julian
 *  Thread Starter [Jim](https://wordpress.org/support/users/jwmc/)
 * (@jwmc)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/filter-for-email-content/#post-14657266)
 * I want to edit the content of an email sent by a plugin. Earlier I was using 
   a different email template plugin; they had a filter “mailtpl/email_content” 
   that I could use to access the content before it went out, and search and replace
   text in a custom function attached to the filter. I was hoping you had something
   similar.
 *  Plugin Author [Hannes Etzelstorfer](https://wordpress.org/support/users/haet/)
 * (@haet)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/filter-for-email-content/#post-14658335)
 * Hey Jim,
    WordPress has this filter on its own. Use the filter wp_mail to customize
   the content or anything else. You can do your changes before our plugin applies
   the template using a filter priority less than 12 e.g. `add_filter( 'wp_mail','
   your_function',10,1);` or you can do it afterwards using a priority greater than
   12 `add_filter( 'wp_mail','your_function',20,1);`
 * [wp_mail documentation](https://developer.wordpress.org/reference/hooks/wp_mail/)
 *  Thread Starter [Jim](https://wordpress.org/support/users/jwmc/)
 * (@jwmc)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/filter-for-email-content/#post-14661839)
 * Excellent! I’m still like a beginner, so really appreciate the excellent info,
   especially the tip about priority. When filtering before the template is applied,
   it didn’t work, I guess because I’m filtering html stuff in part. Filtering after
   worked perfectly.
 * Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Filter for email content?’ is closed to new replies.

 * ![](https://ps.w.org/wp-html-mail/assets/icon-256x256.png?rev=1730334)
 * [Email Template Designer - WP HTML Mail](https://wordpress.org/plugins/wp-html-mail/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-html-mail/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-html-mail/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-html-mail/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-html-mail/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-html-mail/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Jim](https://wordpress.org/support/users/jwmc/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/filter-for-email-content/#post-14661839)
 * Status: resolved