Forem Creators and Builders 🌱

Discussion on: Email sending is not working

Collapse
 
alvarolab profile image
Álvaro Hurtado Mochón • Edited

My laptop is a bit old, so I preferred to use the most services I can on the cloud. I tried using Redis, Postgres, and ElasticSearch on Heroku. That didn't work.

Apparently, the ElasticSearch instances in AWS do not allow certain operations which Forem is using. At the end, I am using ElasticSearch in a docker image, Redis and Postgres in Heroku and running Forem on my local.

Problems I had during the configuration:

  • I had to comment this line system! 'RAILS_ENV="test" bin/rails search:setup' . Why is it needed? Why do I need to setup with 'test'?
  • Some problems with versions incompatibilities (ruby, javascript, node, etc). That was fixed after a bit of back and forth.
  • Fixing now the issue with the SENDGRID_API_KEY . It is not mentioned in many places. Probably it should be part of .env_sample so that people see find it easily.
Collapse
 
djuber profile image
Daniel Uber

Hi Álvaro,

Thanks for the suggestion about adding this variable to the sample environment keys. I've just updated the Forem repo to include that. One reason this was never included before maybe that the .env_sample file was targeted to local development environments (where outbound mail is not sent), and the production environment variables are provided by another mechanism than the .env file. Sendgrid is a service we only use in production, and so no developers ever needed it locally before.

We probably could add more to the documentation around this. There's a very brief mention of Sendgrid as a service for email in docs.forem.com/technical-overview/... , but nothing about providing the api key, hopefully the example file helps in the future.