mailgun / wordpress-plugin

Mailgun's Wordpress Plugin
GNU General Public License v2.0
48 stars 53 forks source link

Respect WordPress core wp_mail filter #151

Closed timiwahalahti closed 1 year ago

timiwahalahti commented 1 year ago

Many plugins rely on the wp_mail filter to do certain things. Mailgun plugin does not respect that filter currently, so some functionalities are broken. For example, our agency's helper plugin allows sending emails only to allow listed addresses on specific occurrences. The check is done in wp_mail filter.

This PR adds the wp_mail filter in order to other plugin functionalities to work.

oleksandr-mykhailenko commented 1 year ago

Hello @timiwahalahti are you sure that this filter will not lead to problems that was described here https://github.com/mailgun/wordpress-plugin/issues/149 ? Because we removed it because off issue with overwriting variables. You solution looks good but we need to test it

timiwahalahti commented 1 year ago

Tested this quicky on one site yesterday, and worked correctly.