[buddypress-trac] [BuddyPress Trac] #6930: Send emails async
buddypress-trac
noreply at wordpress.org
Sat Feb 27 23:38:54 UTC 2016
#6930: Send emails async
--------------------------+----------------------------
Reporter: DJPaul | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: API - Emails | Version:
Severity: normal | Keywords:
--------------------------+----------------------------
Let's enhance `class BP_PHPMailer` to send emails async; otherwise, each
email sent slows down page loading. @r-a-y mentioned this idea in a
comment of an old email ticket, and with my effort in 2.5 for the email
API changes, here's what I'd suggest we do to achieve this:
* Update `BP_PHPMailer->bp_email()` and move the `$phpmailer->Send()`
lines into a helper method, let's call it `send()`. Call this method,
obviously.
* Create a new subclass and re-declare `send()` -- instead of sending the
email, somehow grab all the properties from the email object and the
delivery class as necessary, and store that data in a temporary object
somewhere -- probably a site option.
* Implement a new WP cron hook that fetches all these options from the
database, re-populate the various objects, and sends the email. Send a
POST request off in `BP_PHPMailer_Subclass->send()` to trigger the cron.
* Update filter `bp_send_email_delivery_class` to use the new subclass.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6930>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list