janjaali / sendGrid-mock

SendGrid-Mock serves as a simple server mocking the sendgrid-apis for development purposes.
https://cloud.docker.com/repository/docker/ghashange/sendgrid-mock/general
MIT License
48 stars 19 forks source link

Can't use template in send mail instead of content #6

Closed alexjamesbrown closed 4 years ago

alexjamesbrown commented 4 years ago

Example http request body:

{
    "personalizations": [
        {
            "to": [
                {
                    "email": "to@example.com"
                },
                {
                    "email": "to2@example.com"
                }
            ]
        }
    ],
    "from": {
        "email": "from@example.com"
    },
    "subject": "important subject",

    "dynamic_template_data": {
        "some_value": "1234",
        "some_other_value": "80202"
    },
    "template_id": "my-special-template"
}

This receives a 202 Accepted, but when we run the UI, it has a js error

Uncaught TypeError: Cannot read property 'map' of undefined
    at Cell (Mails.js:82)
    at mountIndeterminateComponent (react-dom.development.js:14811)
    at beginWork (react-dom.development.js:15316)
    at performUnitOfWork (react-dom.development.js:18150)
    at workLoop (react-dom.development.js:18190)
    at HTMLUnknownElement.callCallback (react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
    at invokeGuardedCallback (react-dom.development.js:256)
    at replayUnitOfWork (react-dom.development.js:17437)
    at renderRoot (react-dom.development.js:18309)