Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/29/2021 01:28:50 PM (5 months ago)
Author:
imath
Message:

BP Email: introduce "unnamed" salutation

The member invites feature's goal is to invite external users to join a community. The BP Email feature uses a named salutation by default. As a result, the salutation of invitation emails was "Hi email@…,". The user's name is not yet known and using this kind of salutation is odd. The member invites feature's need is to simply use an "unnamed" salutation eg: "Hi,". To satisfy it we are updating the BP Email type schema with a new property $named_salutation which defaults to true. If this property is false, then the sent email will from now on use an unnamed salutation.

NB: to prevent potential back compatibiliy issues, each kind of salutation has their own filters

  • Use bp_email_get_unnamed_salutation to edit the unnamed one.
  • Use bp_email_get_salutation to edit the default one (named).

Props dcavins for coloring outside the lines a bit 😉

See #8139

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-email.php

    r12913 r12932  
    791791            add_filter( 'bp_locate_template_and_load', '__return_true' );
    792792
     793            // Set up the `$post` global.
     794            global $post;
     795            $reset_post = $post;
     796            $post       = $this->post_object;
     797
    793798            bp_locate_template( bp_email_get_template( $this->post_object ), true, false );
     799
     800            // Reset the `$post` global.
     801            $post = $reset_post;
    794802
    795803            remove_filter( 'bp_locate_template_and_load', '__return_true' );
Note: See TracChangeset for help on using the changeset viewer.