staart / api

🏁🛠️ SaaS backend & API framework based on @nestjs

Home Page:https://staart.js.org/api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to email: XYZ email address

smart-reports opened this issue · comments

Hi @AnandChowdhary

Is there way to debug why the frontend is not sending the signup emails? We're sure we've got Production access setup in AWS and the email is verified and the keys are correct.

Do you see the “send email” log in your console that’s running Staart API? We log “Email sent successfully” or the error. Also, we send a test email when launching, the log of which you should see as well.

Anand - thanks so much for replying....I asked a developer to set it up but looks like he's gone to bed now so he can't check.

I've passed this to him.

Does the site have an admin area to manage members?

Here are some steps to debugging:

  1. Update to the latest version of Staart API (v1.3.153)
  2. You should see the message "Sent email staart@mailinator.com Test from Staart", meaning that emails are being delivered. If you don't see this, you'll see the email configuration error instead.

The logs should look like this, when you run npm run start:

Screen Shot 2020-03-22 at 00 19 12

Yes, the site also has an admin interface. For this, you have to change the role of the user to 3 ("admin") directly in the database. Then, when you log in from this user, you'll see an "Admin" item in the navigation in Staart UI.

We got it to send emails now - turns out email hostname was wrong.

Now we're getting emails but the purple verify button has no link in it..... just "verify your email" but no link inside the button to click on....

Do you know what could be wrong with that?

Have you set up the environment variables for FRONTEND_URL? That's the URL on which your Staart UI app is hosted, e.g., https://staart-demo.o15y.com

https://github.com/staart/api/blob/master/.env.example#L8

Have you set up the environment variables for FRONTEND_URL? That's the URL on which your Staart UI app is hosted, e.g., https://staart-demo.o15y.com

https://github.com/staart/api/blob/master/.env.example#L8

Does the backend API need to be made available on a URL as well? It can't be localhost:8080 with the frontend public facing with a secure URL?

Whats the difference betwen BASE_URL and FRONTEND_URL? We set them both to the same value

No, BASE_URL is the URL you're running the backend on (e.g., http://localhost:4000) and FRONTEND_URL is the URL for the frontend web app (e.g., https://staart-demo.o15y.com). The email URL should then become ${FRONTEND_URL}/path/to/validation

Thanks Anand. How do you get the system to ignore looking for AWS Elasticsearch credentials and use only the local DB? After changing .env it seems the app still look for elasticsearch AWS by default.

Thanks

Do you mean you want to use a custom ElasticSearch endpoint instead of AWS? If this is the case, this is removed (temporarily) because of a config variable mismatch: https://github.com/staart/packages/blob/master/packages/elasticsearch/index.ts#L13.

I'll add this back ASAP, because this was previously supported. For now, only AWS ElasticSearch works for storing logs.

I see - thats fine - its just we cant get AWS to work :(

What permissions do you need to add to the user for it to control ElasticSearch via the API access?

To set up an AWS ElasticSearch user, go to your IAM Management Console → Users → add permission "AmazonESFullAccess" to the user.

I've added support for non-AWS ElasticSearch

🎉 This issue has been resolved in version 2.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀