How to add multiple categories in the sendgrid smtp api in c#? If I use the below code to add the category :
1.) var message=SendGrid.GetInstance();
2.) message.Header.SetCategory(“EmailName”);
It adds the "EmailName" as category successfully. If I need to add multiple categories and write the second step statement multiple times then it creates only the last category and overrides the previous categories.
Thanks
Looking for same thing as OP via google and stumbled on this question. It looks like SendGrid C# library now supports multiple categories, so thought I'd add it here in case others stumble here too.
IEnumerable<string> categories = new string[] { "c1", "c2" };
message.Header.SetCategories(categories);
Link to github issue where this was resolved:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With