8000 [Webhook][RemoteEvent] SendgridPayloadConverter does not support string category · Issue #59374 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericabouaf opened this issue Jan 6, 2025 · 0 comments

Comments

@ericabouaf
Copy link
Contributor

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

@ericabouaf ericabouaf added the Bug label Jan 6, 2025
nicolas-grekas added a commit that referenced this issue Jan 7, 2025
…ry support (ericabouaf)

This PR was merged into the 6.4 branch.

Discussion
----------

[RemoteEvent][Webhook] fix SendgridPayloadConverter category support

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #59374
| License       | MIT

Commits
-------

186daa5 [Webhook][RemoteEvent] fix SendgridPayloadConverter category support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0