Support » Plugin: Post SMTP Mailer/Email Log » Feature Request: Filter to Override / Short-Circuit wp_mail

  • Jessie

    (@jproffitt71)


    This plugin is so close to perfect, but I am running into an issue that is currently impossible to solve while using this plugin: the SMTP process takes too long to wait for on the frontend and I need to add a queue that sends the emails out on a cronjob.

    The only way I can see doing this is hooking into / replacing wp_mail and saving emails to a database queue then exiting early without sending it (then handling it during a cronjob). Post SMTP doesn’t offer anyway to hook into wp_mail and override it though, so I have no way to do this.

    Could Post SMTP add a filter like “post_smtp_wp_mail_send” that passes the wp_mail arguments and null, and then returns the result of that filter immediately if it’s anything but null? That way a developer could hook in and take over the whole process if they needed to (or do something incidental and return null to let it proceed as normal).

    • This topic was modified 1 year, 2 months ago by Jessie.
    • This topic was modified 1 year, 2 months ago by Jessie.
    • This topic was modified 1 year, 2 months ago by Jessie.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author yehudah

    (@yehudah)

    How many emails do you need to send? who is the provider?

    I can say that for mailgun there is a built-in option to send chunks of 1000 emails each.

    Jessie

    (@jproffitt71)

    The issue isn’t the number of emails, it’s that the SMTP service I am using takes a few seconds to send an email, so when a user submits a contact form, they get antsy after a couple seconds and click “Send” again, or complain that it’s not working. I don’t want to change SMTP services because that would require me to log into 40+ websites and reconfigure each one with a new SMTP server hostname.

    What I want is for Post SMTP to either natively queue emails or give developers the hooks needed to implement them themselves (well, just one hook really).

    Personally I think the hook is a good idea regardless. Developers could use that to do any number of things, for instance spam filtering. I could submit a pull-request if you would like to add this hook to PostmanWpMailBinder.

    • This reply was modified 1 year, 2 months ago by Jessie.
    • This reply was modified 1 year, 2 months ago by Jessie.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Feature Request: Filter to Override / Short-Circuit wp_mail’ is closed to new replies.