ActiveCampaign / postmark-wordpress

The Official Postmark Wordpress Plugin
GNU General Public License v2.0
17 stars 17 forks source link

Implement wp_mail_succeeded hook #88

Closed ChexWarrior closed 2 years ago

ChexWarrior commented 2 years ago

Hello,

I've added the wp_mail_succeeded hook (recently added in WP 5.9) to the plugin's wp_mail method. Pretty simple change, though I'm curious on opinions for what values should be passed to the hook, currently I've opted to pass the values that were actually sent to the Postmark API instead of the initially passed values to the wp_mail call.

pgraham3 commented 2 years ago

@ChexWarrior Thanks for the contribution! I agree with the approach of using the values passed to the API as well.

I did make one small change to look for the HTMLBody first before the TextBody here.

This is due to the fact that an HTML Body and a Text Body can both be present in cases where the Content-Type header is not explicitly set to text/html (see here).

ChexWarrior commented 2 years ago

@pgraham3 Sounds good!