Forem Creators and Builders

loading...

Email sending is not working

Álvaro Hurtado Mochón
Software engineer turned into Product manager
・1 min read

Hi everyone,

First of all, thanks everyone for the hard work. I really like Forem and I would like to adapt it to my own community. I would like to help also, although, I am more of a Python engineer.

I am trying to run Forem on a local environment, kinda. I am running postgresql and redis on Heroku but I am running elasticsearch and Forem in my local.

It finally worked and I got to see it in my browser! Success!

However, after seeing the first screen on the setup, where I registered my self, I did not receive the confirmation email.

I tried adding the API keys of Mailchimp but nothing changed. I checked on the spam folder but I found nothing. I couldn't see any error in the console either.

I am locked out! I can't continue configuring it because I can't login, I can't login because I can't confirm my own account.

Any idea of what I am doing wrong?

Discussion (7)

Collapse
akhil profile image
Akhil Naidu • Edited

Hey, it's nice that you have a working instance, and I would like to know more about the way you configured your Forem.

It would be better for you to use the default user than creating an account for your self. The default credentials are as follows:
Email: admin@forem.local
Password: password

After using these credentials, you will be logged in as an admin with the superuser's role. Now you can access your /admin/config section to further configuration.

Collapse
alvarolab profile image
Álvaro Hurtado Mochón Author • 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.

Collapse
benjaminb profile image
Benjamin Bilgehan

/admin/customization/config

i am able to access here but when i type domain.com/admin/config
404 comes

Collapse
alex profile image
Alex Smith

There could be a handful of things contributing to this...here are some initial thoughts.

  1. Mailchimp is used for marketing emails, SendGrid is used to send transactional emails (i.e. account confirmations). Do you have SendGrid configured?
  2. Are you running the app in production mode?
  3. You can log into the console of the app (still assuming you're running it locally) by doing rails console. Then, you can find your User record and manually confirm it so you can log in (i.e. User.last.confirm).
  4. It may help to make sure you have Sidekiq running as some emails are sent asynchronously.
Collapse
alvarolab profile image
Álvaro Hurtado Mochón Author

Nop... SendGrid is not configured, that is most likely the cause. Otherwise, I will confirm manually for now.

Thanks for the help!

Collapse
sidthedev profile image
Siddharth Chaudhary

Lol I found a workaround around this. What I found is that the contents of the email were logged to the console. I clicked and verified myself.