Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/28/2021 11:52:39 PM (6 months ago)
Author:
dcavins
Message:

Member Invites: Install emails on upgrade to 8.0.

Include the new emails and descriptions and install them
during the upgrade to 8.0.

See #8139.

File:
1 edited

Legend:

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

    r12912 r12929  
    703703    // Register and Activate are not components, but need pages when
    704704    // registration is enabled.
    705     if ( bp_get_signup_allowed() ) {
     705    if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed()  ) {
    706706        foreach ( array( 'register', 'activate' ) as $slug ) {
    707707            if ( ! isset( $pages[ $slug ] ) ) {
     
    34733473    if ( 'settings-verify-email-change' === $email_type && isset( $args['tokens']['displayname'] ) ) {
    34743474        $email->set_to( $to, $args['tokens']['displayname'] );
     3475    // Emails sent to nonmembers will have no recipient.name populated.
     3476    } else if ( 'bp-members-invitation' === $email_type ) {
     3477        $email->set_to( $to, $to );
    34753478    } else {
    34763479        $email->set_to( $to );
     
    38163819            'post_title'   => __( '[{{{site.name}}}] You have an invitation to the group: "{{group.name}}"', 'buddypress' ),
    38173820            /* translators: do not remove {} brackets or translate its contents. */
    3818             'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the group: &quot;{{group.name}}&quot;.\n{{invite.message}}\n<a href=\"{{{invites.url}}}\">Go here to accept your invitation</a> or <a href=\"{{{group.url}}}\">visit the group</a> to learn more.", 'buddypress' ),
    3819             /* translators: do not remove {} brackets or translate its contents. */
    3820             'post_excerpt' => __( "{{inviter.name}} has invited you to join the group: \"{{group.name}}\".\n\nTo accept your invitation, visit: {{{invites.url}}}\n\nTo learn more about the group, visit: {{{group.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
     3821            'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the group: &quot;{{group.name}}&quot;.\n\n{{invite.message}}\n\n<a href=\"{{{invites.url}}}\">Go here to accept your invitation</a> or <a href=\"{{{group.url}}}\">visit the group</a> to learn more.", 'buddypress' ),
     3822            /* translators: do not remove {} brackets or translate its contents. */
     3823            'post_excerpt' => __( "{{inviter.name}} has invited you to join the group: \"{{group.name}}\".\n\n{{invite.message}}\n\nTo accept your invitation, visit: {{{invites.url}}}\n\nTo learn more about the group, visit: {{{group.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
    38213824        ),
    38223825        'groups-member-promoted' => array(
     
    38673870            /* translators: do not remove {} brackets or translate its contents. */
    38683871            'post_excerpt' => __( "Your membership request for the group \"{{group.name}}\" has been rejected.\n\nTo request membership again, visit: {{{group.url}}}", 'buddypress' ),
     3872        ),
     3873        'bp-members-invitation' => array(
     3874            /* translators: do not remove {} brackets or translate its contents. */
     3875            'post_title'   => __( '{{inviter.name}} has invited you to join {{site.name}}', 'buddypress' ),
     3876            /* translators: do not remove {} brackets or translate its contents. */
     3877            'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the site: &quot;{{site.name}}&quot;.\n\n{{usermessage}}\n\n<a href=\"{{{invite.accept_url}}}\">Accept your invitation</a> or <a href=\"{{{site.url}}}\">visit the site</a> to learn more.", 'buddypress' ),
     3878            /* translators: do not remove {} brackets or translate its contents. */
     3879            'post_excerpt' => __( "{{inviter.name}} has invited you to join the site \"{{site.name}}\".\n\n{{usermessage}}\n\nTo accept your invitation, visit: {{{invite.accept_url}}}\n\nTo learn more about the site, visit: {{{site.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ),
    38693880        ),
    38703881    ) );
     
    40114022    $core_user_activation = array(
    40124023        'description'   => __( 'Recipient has successfully activated an account.', 'buddypress' ),
     4024    );
     4025
     4026    $members_invitation = array(
     4027        'description'   => __( 'A site member has sent a site invitation to the recipient.', 'buddypress' ),
     4028        'unsubscribe'   => array(
     4029            'meta_key'  => 'notification_bp_members_invite',
     4030            'message'   => __( 'You will no longer receive emails when you are invited to join this site.', 'buddypress' ),
     4031        ),
    40134032    );
    40144033
     
    40314050        'groups-membership-request-rejected' => $groups_membership_request_rejected,
    40324051        'core-user-activation'               => $core_user_activation,
     4052        'bp-members-invitation'              => $members_invitation,
    40334053    );
    40344054
     
    41634183 *    @type string $user_id           The ID of the user to whom the notification is sent.
    41644184 *    @type string $redirect_to       Optional. The url to which the user will be redirected. Default is the activity directory.
     4185 *    @type string $email             Optional. The email address of the user to whom the notification is sent.
    41654186 * }
    41664187 * @return string The unsubscribe link.
Note: See TracChangeset for help on using the changeset viewer.