Email setup on Self hosted server
# support
s
I am not able to find proper documentation to setup self hosted solution, e.g. When i add any user in project I am getting any emails, when I changed the config file with sedngrid smtp setting I am getting below error "User created, email couldn't be sent. Could not send email. Make sure you have AWS SES set up." I added smtp settings inside config file as per this PR - https://github.com/medplum/medplum/pull/2530 ,Any idea where its breaking? Here is the smtp setting what I added "smtp": { "host": "smtp.sendgrid.net", "port": 587, "username": "ss@ss.com", "password": "sendgrid api key" }
r
Hi @snehal_u , have you added the approprate SMTP settings to your server config file, as documented here: https://www.medplum.com/docs/self-hosting/sendgrid?
?
After updating the server config files, make sure to restart the server so that you can pick up the chagnes
s
Yes I did, still the error
r
Nothing obvious jumps out at me based on yoru config. Are you able to check in the sendgrid console to see if requests are coming through?
s
just checked, no request on Sendgrid
this is config file
r
Hi @snehal_u - i deleted your config file screenshot to avoid leaking the partial API key. If you're running the server on localhost, you should be able to set up debug logging. COuld you do this just to confirm that the SMTP services was picked up by the server correctly?
s
I am running on ec2
"npm run dev" command it is
Thanks for removing the screenshot
r
Hi @snehal_u I have a hypotheses on what might be going on here. After the initial deploy on EC2, all subsequent changes to the configuration need to happen inside AWS paramater store. This is admittedly a rough edge, and we've filed an issue here: https://github.com/medplum/medplum/issues/3412
If you go to your parameter store, you can add a key for your your SMTP settings (if it's not already there). THen it should get picked up when you restart the server https://www.medplum.com/docs/self-hosting/config-settings#server-config
Sorry about the confusion
s
i see, but how its authenticating with paramter store? Where we are setting up aws keys?
I though smtp settings are picked up from medplum_config file
I checked AWS parameter store, nothing there under our acct, any direction where to look will be really helpful. Thanks for your help @rahul1
r
@snehal_u I might be a bit confused. I was under the impression that you were running on AWS, not on localhost. Am I correct that you are running on EC2, following the instructions set forth in our AWS install docs? (http://localhost:3000/docs/self-hosting/install-on-aws)?
s
I am running on ec2 just like local setup, ran command "npm run dev", I want to check it out before we setup properly using CDK etc, Devops team is busy so just setting up myself quickly
r
Hi @snehal_u , sorry about the delay on this. When the server loads up, it prints out the server config to the console. Seeing that config might help troubleshoot
@snehal_u - i want you to know that we've added a new CLI option,
update-config
to allow you to sync your local config to the AWS parameter store: https://github.com/medplum/medplum/pull/3725/files