FluentEmail icon indicating copy to clipboard operation
FluentEmail copied to clipboard

SendGrid demands categories to be set

Open robertjf opened this issue 2 years ago • 8 comments

When we upgraded to the latest release, our emails stopped sending via SendGrid with the following error in the response:

"{\r\n  \"message\": \"The categories array, when used, must have at least one category.\",\r\n  \"field\": \"categories\",\r\n  \"help\": \"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.categories\"\r\n}"

Installed version: 3.0.2

robertjf avatar Mar 31 '22 22:03 robertjf

Workaround seems to be to set the .Tag property to some string.

jazzmanro avatar Apr 03 '22 08:04 jazzmanro

We just hit this same issue with SendGrid e-mails failing to send after updating.

jimmyville avatar Jun 07 '22 06:06 jimmyville

Issue still exists and the ☝️ workaround works

mishal153 avatar Jun 28 '22 03:06 mishal153

So apparently I had the same issue, the initial call was :

 var sendResponse = await _fluentEmail
                    .To(email)
                    .Subject(mailTitle)
                    .Body(body, true)
                    .Tag("string")
                    .SendAsync();

which resulted in sending only the first email in a Foreach loop, so I had to replace it to :

 var sendResponse = await _fluentEmail
                    .To(email)
                    .Subject(mailTitle)
                    .Body(body, true)
                    .Tag($"{GenerateUnique()}")
                    .SendAsync();

to be able to work around this issue.

Spylak avatar Jun 30 '22 09:06 Spylak

I think a fix for this has already sneaked into master via this PR. So just a release away 😉

lahma avatar Oct 05 '22 14:10 lahma

Okay.... this is still not yet realease

umarisazak avatar Mar 03 '23 11:03 umarisazak

Thanks @jazzmanro for the work-around. Seems the PR is merged but not released. I guess @lukencode is buried in his full-time role as dad and CTO (understandable). Does anyone else have release authority? @bjcull? 🙏

jfoshee avatar Apr 28 '23 19:04 jfoshee

I can't release anything on this repo, but I made a fork and integrated a bunch of the open PRs and made my own release:

https://github.com/jcamp-code/FluentEmail

JohnCampionJr avatar Apr 28 '23 22:04 JohnCampionJr