CometChat Pro Email Notification is not working

Hi, the Email Notification is not working for my CometChat app. I already added the Sendgrid API Key, SendGrid Template ID, Unsubscribe Group ID, and CometChat API key with full access. Users can send and receive messages. I also implemented read receipts using the CometChat’s markAsRead method. Each user has a metadata like so: {“rawMetadata”:"{@private:{“email":"example@gmail.com”}}"}

Using the Javascript SDK, CometChat Pro Version: 2.0.6

1 Like

hello @patrick
the metadata should be of the format
{"@private":{“email":"example@gmail.com”}}
and not in the rawMetadata key.
please check the format once again and do let us know if it works.
if you still face any issues, do let us know and we will be glad to help you out with this.

2 Likes

Thank you @aditya.gokula, the email notification works! I was missing the quotations around @private. The user now shows no RawMetadata in the CometChat dashboard, just {"@private":{“email":"example@gmail.com”}}

Could you guys update the metadata body param by adding quotations around @private in the prefilled input field? Because if there are no quotations around @private, then you will get a rawMetaData key in the response.

https://prodocs.cometchat.com/reference#updateuser

Once again, thank you for the help!

1 Like

Hello @patrick,
So the reason the rawMetadata key was added as a failsafe mechanism so that even if the data provided in the metadata field was not a correctly formatted JSON, the data for the user or group is not lost. However, the point mentioned by you is valid. Let me have a discussion with the team and see what can be done. Adding quotes to the fields might not be possible i feel, but we can return an error if the metadata JSON is malformed. Let me have a discussion and check if something can be done.
Thank you for your valuable feedback :slight_smile:

1 Like

Hi @patrick,

Thank you for reporting the issue. The API reference has been updated with @private in quotes.

Warm Regards,

Ketan Yekale
CometChat Team

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.