You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have multiple microservices that are publishing events to my email service lambda funciton to send their own SendGridMessage. The problem is that I need to be able to serialize the SendGridMessage Class and to deserialize in my email service function.
Currently, I end up with multiple field missing, making it impossible to send my message.
Could we have a function that help us revives the SendGridMessage from a serialized input?
If I remember correctly the serialization of the message then Deserialization of the message misses the To and the Template Id.
As a bypass I send the request generated JSON (with .Serialize()) to my message API then directly send it from the API, however I cannot edit the message afterwards. Maybe implement a Deserialize() method that does the inverse if Serialize()?
I'm not sure what you mean by "I cannot edit the message afterwards". I'm thinking you would just modify the JSON before sending (example of calling the mail/send endpoint with the raw JSON). Please let me know if that would work for your use case. Thank you!
Thats the current workaround im using. What I mean is you can’t reconstruct the SendGridMessage object from the generated output and then apply other methods on the object because the deserialization is not working correctly!
Activity
shwetha-manvinkurke commentedon Apr 19, 2021
@sebastienlabine Do you have a code sample that you can share? What fields are missing in the deserialized output?
sebastienlabine commentedon Apr 26, 2021
@shwetha-manvinkurke Sorry for the late answer. The most basic example was with
If I remember correctly the serialization of the message then Deserialization of the message misses the To and the Template Id.
As a bypass I send the request generated JSON (with .Serialize()) to my message API then directly send it from the API, however I cannot edit the message afterwards. Maybe implement a Deserialize() method that does the inverse if Serialize()?
thinkingserious commentedon Apr 26, 2021
Hello @sebastienlabine,
I'm not sure what you mean by "I cannot edit the message afterwards". I'm thinking you would just modify the JSON before sending (example of calling the mail/send endpoint with the raw JSON). Please let me know if that would work for your use case. Thank you!
With best regards,
Elmer
sebastienlabine commentedon Apr 27, 2021
Thats the current workaround im using. What I mean is you can’t reconstruct the SendGridMessage object from the generated output and then apply other methods on the object because the deserialization is not working correctly!
thinkingserious commentedon Apr 27, 2021
Thanks for clarifying @sebastienlabine!
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.