When sending emails, I get this error message.

GuzzleHttp\Exception\ClientException: Client error: POST https://graph.microsoft.com/v1.0/users/<user>/sendmail resulted in a 400 Bad Request response: {"error":{"code":"RequestBodyRead","message":"The property 'address' does not exist on type 'microsoft.graph.recipient'. Make sure to only use property names that are defined by the type or mark the type as open type."}} in GuzzleHttp\Exception\RequestException::create() (line 113 of /opt/drupal/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php).

splitAddresses() does not correctly build the array structure ("toRecipients": [{"address": "<email>", "name": "<recipient name>"}]).

I have never created a patch so hopefully I did it right.

CommentFileSizeAuthor
graph_mail-fix_email_addresses.patch468 bytesTobyLeduc

Issue fork graph_mail-3416600

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

TobyLeduc created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes

  • apaderno committed b2842756 on 2.0.x
    Issue #3416600 by TobyLeduc, apaderno: property 'address' does not exist...

  • apaderno committed 6d801db0 on 1.0.x
    Issue #3416600 by TobyLeduc, apaderno: property 'address' does not exist...
avpaderno’s picture

Status: Active » Fixed

Thank you for finding out what the problem was and providing a patch!
The change is correct. It is the same data structure the code was already using for the from value (with the exception that name is not set).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avpaderno’s picture

Version: 2.0.x-dev » 1.0.x-dev