Skip to:
Content

BuddyPress.org

Changeset 10500


Ignore:
Timestamp:
02/03/2016 07:55:29 PM (4 years ago)
Author:
djpaul
Message:

Emails: un-deprecate bp_activity_sent_mention_email action.

All functions where we send an email trigger a final action after the email's sent. The recent changes for BP 2.5's email overhaul moved all of these into the 2.5 backwards compatibility file, which is triggered by the new "email sent" actions and filters in bp_send_email().

Subsequent investigation of all similar actions revealed that only bp_activity_sent_mention_email had core functions hooked to it. Also, bp_activity_sent_mention_email was the only action hook that *always* triggered -- the other similar actions did not trigger if the recipient had chosen to disable email notifications. This change moves the action back into its original location, fixing unit tests and notification functionality, but it does not pass the subject/content/message arguments to the action as we no longer have access to those outside of an BP_Email instance.

Follow-up is required to ensure the 2.5 backwards compatibility code is being loaded correctly, or if this was some quirk of our unit test environment.

See #6592

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-notifications.php

    r10487 r10500  
    8787        bp_send_email( $email_type, $receiver_user_id, $args );
    8888    }
     89
     90    /**
     91     * Fires after the sending of an @mention email notification.
     92     *
     93     * @since 1.5.0
     94     * @since 2.5.0 $subject, $message, $content arguments unset and deprecated.
     95     *
     96     * @param BP_Activity_Activity $activity         Activity Item object.
     97     * @param string               $deprecated       Removed in 2.5; now an empty string.
     98     * @param string               $deprecated       Removed in 2.5; now an empty string.
     99     * @param string               $deprecated       Removed in 2.5; now an empty string.
     100     * @param int                  $receiver_user_id The ID of the user who is receiving the update.
     101     */
     102    do_action( 'bp_activity_sent_mention_email', $activity, '', '', '', $receiver_user_id );
    89103}
    90104
  • trunk/src/bp-core/deprecated/2.5.php

    r10499 r10500  
    665665function bp_core_deprecated_email_actions( $email, $delivery_status ) {
    666666    $pre_2_5_emails = array(
    667         'activity-at-message',
    668667        'activity-comment',
    669668        'activity-comment-author',
     
    672671        'friends-request',
    673672        'friends-request-accepted',
    674         'groups-at-message',
    675673        'groups-details-updated',
    676674        'groups-invitation',
     
    726724         */
    727725        do_action( 'bp_activity_sent_reply_to_reply_email', $tokens['parent-comment-user.id'], $email_subject, $email_content, $tokens['comment.id'], $tokens['commenter.id'], array() );
    728 
    729     } elseif ( $email_type === 'activity-at-message' || $email_type === 'groups-at-message' ) {
    730         /**
    731          * Fires after the sending of an @mention email notification.
    732          *
    733          * @since 1.5.0
    734          * @deprecated 2.5.0 Use the filters in BP_Email.
    735          *
    736          * @param BP_Activity_Activity $activity         Activity Item object.
    737          * @param string               $email_subject    Email notification subject text.
    738          * @param string               $email_content    Email notification message text.
    739          * @param string               $content          Content of the @mention.
    740          * @param int                  $receiver_user_id The ID of the user who is receiving the update.
    741          */
    742         do_action( 'bp_activity_sent_mention_email', $tokens['activity'], $email_subject, $email_content, $tokens['content'], $tokens['receiver-user.id'] );
    743726
    744727    } elseif ( $email_type === 'core-user-registration' ) {
Note: See TracChangeset for help on using the changeset viewer.