bot medplum client is not logged in
# support
s
Hi, the Almighty Medplum team! I am trying to send an email in a Lambda bot:
Copy code
export async function handler(medplum: MedplumClient, event: BotEvent): Promise<any> {
  medplum.sendEmail(...);
}
However, the email sending failed, because the medplum client is not logged in... Any pointer on what could cause this? I am self-hosting medplum server on AWS. Thank you!
The medplumClient in the bot can read resource but just can't send out email. Here is the error I get:
Copy code
Error sending email: {"outcome":{"resourceType":"OperationOutcome","id":"forbidden","issue":[{"severity":"error","code":"forbidden","details":{"text":"Forbidden"}}],"extension":[{"url":"https://medplum.com/fhir/StructureDefinition/tracing","extension":[{"url":"requestId","valueId":"f1364ba8-3da0-4f0b-82fc-2d196ee64249"},{"url":"traceId","valueId":"bb0e55ea-7998-48e0-a447-50875c288d3f"}]}]}}
I tried making the bot an admin but still got the same error.
I got this resolved by adding "email" as a project feature.
147 Views