About Fynd Platform Communication Email template API

Can we send some dynamic params via Personalization to be rendered on email template runtime via FDK api? If yes can you please share that API.

Also what i see here


Email | Fynd Platform
for personalization, tags needs to be created and assign values on platform only. We need values of those tags to be assigned values dynamically. Please help urgently.

Yes, you can dynamically send parameters via Personalization to render them within an email template at runtime using the FDK API. To achieve this, you can leverage the Update an Email Template API endpoint. This allows you to update an email template and incorporate dynamic parameters for runtime rendering.

API Endpoint: Update an Email Template

To update an email template with dynamic content, use the following endpoint:

Endpoint:

PUT /service/platform/communication/v1.0/company/{company_id}/application/{application_id}/email/templates/{id}

Hi Suditya, Editing Email Template every time before sending email to change any parameters to be furnished to email templates is not good solution as if I need to send email to 1000 emails saying
Hi Name of person
I need to call this update API 1000 times which is not good architecture at all. Please let me know if my understanding is not correct or help in identifying different solutions.

Hi @sachingupta22,

You’re absolutely right. However, we don’t need to update the email template every time we call the API. Instead, we just need to pass the template variables when sending the email. These variables will dynamically populate the placeholders (which are predefined in the platform).

For reference, here’s a sample working cURL request with dummy values:

curl --location 'https://api.fynd.com/service/platform/communication/v1.0/company/8040/application/669f9a2ef82336472d6fe45d/engine/send-async' \
--header 'Content-Type: application/json' \
--header 'Cookie: [Include relevant cookies]' \
--header 'Authorization: Bearer [Your Token]' \
--data-raw '{
    "payload": {
        "data": [
            {
                "name": "John Doe",
                "hello": "Welcome to Fynd!",
                "to": "[email protected]"
            }
        ],
        "email": {
            "template": {
                "key": "slug",
                "value": "welcome-email-template"
            }
        },
        "application": "669f9a2ef82336472d6fe45d"
    },
    "meta": {
        "job_type": "event",
        "action": "send",
        "trace": "unique-trace-id-12345"
    }
}'

Example of variables defined on the platform:

{
  "name": "John Doe",
  "hello": "Welcome to Fynd!"
}

These variables will be dynamically replaced with the corresponding values during email dispatch.

Hope this clarifies the process.


1 Like

Thanks !! This is perfect solution we are looking for. So in payload data we can send variable tag and its dynamic value Thanks.