[buddypress-trac] [BuddyPress Trac] #7044: Emails: Passing an email address to `bp_send_mail()` does not render `{recipient.name}` token

buddypress-trac noreply at wordpress.org
Tue May 3 07:42:22 UTC 2016


#7044: Emails: Passing an email address to `bp_send_mail()` does not render
`{recipient.name}` token
--------------------------+--------------------
 Reporter:  r-a-y         |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  2.6
Component:  API - Emails  |     Version:  2.5.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+--------------------

Comment (by DJPaul):

 I would only suggest we watch how we use `empty()` here. I've seen it used
 more and more over the last year in places where it's not strictly
 necessary. Take this patch:

 {{{
 if ( ! empty( $name ) ) {
   $this->name = $name;
 }
 }}}

 `$name` is an optional function argument so it will always be set. It's
 not an array reference, so we don't need the inherent "is this thing set"
 that `empty()` does. This statement is easily simplified to `if ( $name
 )`. In my opinion, doing so lowers the code complexity a very tiny bit and
 increases readability.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7044#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list