Skip to:
Content

BuddyPress.org

Changeset 11401


Ignore:
Timestamp:
01/28/2017 11:48:41 AM (8 years ago)
Author:
djpaul
Message:

Emails: add action before email is validated and sent.

Allows third-party plugins to customise the email after BuddyPress has built it.

Fixes #7427

Props mahype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r11363 r11401  
    30903090 *                                             or an array containg the address and name.
    30913091 * @param array                    $args {
    3092  *     Optional. Array of extra. parameters.
     3092 *     Optional. Array of extra parameters.
    30933093 *
    30943094 *     @type array $tokens Optional. Assocative arrays of string replacements for the email.
     
    31353135    $email->set_to( $to );
    31363136    $email->set_tokens( $args['tokens'] );
     3137
     3138    /**
     3139     * Gives access to an email before it is sent.
     3140     *
     3141     * @since 2.8.0
     3142     *
     3143     * @param BP_Email                 $email      The email (object) about to be sent.
     3144     * @param string                   $email_type Type of email being sent.
     3145     * @param string|array|int|WP_User $to         Either a email address, user ID, WP_User object,
     3146     *                                             or an array containg the address and name.
     3147     * @param array                    $args {
     3148     *     Optional. Array of extra parameters.
     3149     *
     3150     *     @type array $tokens Optional. Assocative arrays of string replacements for the email.
     3151     * }
     3152     */
     3153    do_action_ref_array( 'bp_send_email', array( &$email, $email_type, $to, $args ) );
    31373154
    31383155    $status = $email->validate();
Note: See TracChangeset for help on using the changeset viewer.