Undefined array key 1 in Drupal\sendgrid_integration\Plugin\Mail\SendGridMail->doMail()

Created on 24 January 2024, 10 months ago
Updated 12 September 2024, 2 months ago

Problem/Motivation

If the parseAddress() returns array with only e-mail, than there is no array element with key 1. That cause the warning.
in SendGridMail.php:

Proposed resolution

Check if $fromaddrarray[1] isset, otherwise set site name:
$data['fromname'] = isset($fromaddrarray[1]) ? strval($fromaddrarray[1]) : strval($sitename);

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024