Email Template Code

This allows you to make changes or modifications to the email data before sending it. You can customize the data, format, or structure as needed to meet specific requirements.

Here is the sample email code:

async function customizeERP(userData, apiOperations) {
    const tableName = "Sales Orders Table";
    let recipients = {
        to: ["examples@domain.com"]
    }
    if (userData && userData.length > 0) {
        const returnData = await Promise.all(userData.map(async(row) => {
            // Your Code Starts Here
        }));
    }
    return {
        data: returnData,
        recipients: recipients
    }
}

The Output structure should be this:

{
    "data": {
        "count": 1,
        "rows": [{
            "id": 1,
            "columnName1": "columnValue1",
            "columnName2": "columnValue2",
            "columnName3": "columnValue3"
        }]
    },
    "recipients": {
        "to": []
    }
}
Last updated on
Transform Data into Decisions with Supista – Your Intelligent Data Partner
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Cookie Policy. Learn More.