Email: Check first name exists before using.

The previous check worked when the field existed as an empty string, but threw a notice when it didn't exist.
This commit is contained in:
Ian Dunn 2022-08-10 11:41:14 -07:00
parent 4dc03ada83
commit 993bd53765
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB

View file

@ -215,7 +215,7 @@ function send_contributor_inactive_email( array $contributor ) : bool {
* Their first name is ideal, but their username is the best fallback because `nickname`, `display_name`,
* etc are too formal.
*/
$name = $contributor['first_name'] ? $contributor['first_name'] : '@' . $contributor['user_nicename'];
$name = empty( $contributor['first_name'] ) ? '@' . $contributor['user_nicename'] : $contributor['first_name'];
$subject = 'Please update your Five for the Future pledge';
$short_team_names = array_map( function( $team ) {