Error with sendEmail() api
# support
y
I am self-hosting a medplum instance and trying to use
sendEmail()
from my bot. I added Email as a feature in my project settings but still get this error when I try to send an email:
Copy code
{
  "errorType": "Error",
  "errorMessage": "{\"msg\":\"Internal Server Error\"}",
  "trace": [
    "Error: {\"msg\":\"Internal Server Error\"}",
    " at Tt.request (/opt/nodejs/node_modules/@medplum/core/dist/cjs/index.cjs:42:8692)",
    " at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
    " at async Object.handler (/var/task/user.js:8:5)",
    " at async exports.handler (/var/task/index.js:24:18)"
  ]
}
My code matches the example in the docs:
Copy code
await medplum.sendEmail({
    to: 'eric@example.com',
    subject: `Hello ${firstName} ${lastName}!`,
    text: `Hello ${firstName} ${lastName}!`,
  });
r
Hi @yurtric - are you self-hosting on AWS?
y
@rahul1 Yes, I am self-hosting on AWS. I am executing this email bot from the code editor in my own instance of medplum
181 Views