Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Webhook][RemoteEvent] SendgridPayloadConverter does not support string category #59374

Closed
@ericabouaf

Description

@ericabouaf

Symfony version(s) affected

6.4.17

Description

When sending an email using Sendgrid and the "category" field as a string, the webhook parser fails :

AbstractMailerEvent::setTags(): Argument #1 ($tags) must be of type array, string given, called in vendor/symfony/sendgrid-mailer/RemoteEvent/SendgridPayloadConverter.php on line 54

According to Sendgrid's documentation (https://www.twilio.com/docs/sendgrid/for-developers/tracking-events/event#json-objects) :

category - Categories are custom tags that you set for the purpose of organizing your emails. If you send single categories as an array, they will be returned by the webhook as an array. If you send single categories as a string, they will be returned by the webhook as a string.

How to reproduce

  • Have a Symfony app with the sendgrid webhook installed
  • Send an email with the sendgrid category as a string

=> the SendgridPayloadConverter should fails when calling setTags (which expects an array)

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions