How to use ReactJS to make transactional E-mails

I would like to know how I can make this curl request in my react app and how will I code this up on a click of a button.
The transactional email documentation is:

Hi @John_Abraham,

Welcome to the community :wave: and thanks for being patient!

I assume that this is probably an external app. I would recommend making the request via a middleware (For example a Node Express server) that has the credentials for the API and returns the data/acknowledgment to the client-side script via APIs. Making calls from the client-side directly is likely to lead to CORs issue.

On the other hand, if this is a Freshworks SDK app, you can make use of $request or client.request method to make an API call. Ensure to configure the iparams to contain the credentials. You can also leverage product events and frontend events to make it event-driven.

Feel free to add further details pertaining to the scenario

Reference:
https://developers.freshworks.com/crm/docs/request-method/
https://developers.freshworks.com/crm/docs/events-methods/
https://developers.freshworks.com/crm/docs/product-events/

Tutorial:
https://developers.freshworks.com/tutorials/codelabs/freshdesk-basics/index.html?index=..%2F..index#0

1 Like