[buddypress-trac] [BuddyPress Trac] #6460: core function for all calls to wp_mail

buddypress-trac noreply at wordpress.org
Thu May 28 14:15:43 UTC 2015


#6460: core function for all  calls to wp_mail
-------------------------+-----------------------------
 Reporter:  shanebp      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  API          |    Version:  2.2.3
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 There are ~15 calls to wp_mail.
 Instead of separate calls, it would be useful to send them all to a core
 function, maybe '''bp_wp_mail()''' which would be the only function that
 calls '''wp_mail'''.

 '''bp_wp_mail''' would have an apply_filters hook(s) before it calls
 '''wp_mail'''.

 As clients increasingly use email tracking & template plugins ( Mandrill,
 etc), having a single function for all calls to wp_mail would make it
 easier than a slew of filter functions for all the wp_mail calls.

 Currently, all the calls to wp_mail are preceded with apply_filters hooks.
 Those hooks would remain.

 But instead of:
 {{{
 wp_mail( $to, $subject, $message );
 }}}

 Use:
 {{{
 bp_wp_mail( $to, $subject, $message, $type );
 // $type tells you where it came from, for example: new_message
 }}}

 And the function is something like:

 {{{
 function bp_wp_mail( $to, $subject, $message, $type ) {
     // add apply_filters hook(s) here
     wp_mail( $to, $subject, $message );
 }
 }}}

 Just wanted to float the idea before creating a patch.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6460>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list