Skip to main content
Ask A Question
You’re not receiving notifications from this thread.

Sending emails not working, no errors found in the terminal

General • Asked by Felix Pujols

I'm new on rails, I would appreciate any help. This is the repository of this project:

when a client signup an email is sent to the mail of the admin to approve that client otherwise the client will never be able to log in

I am having problems sending emails, in development and production environment. I have tried everything, but nothing is working for me.


class UserMailer < ApplicationMailer
  default from: '[email protected]'
      layout 'mailer'

      def new_user_waiting_for_approval(user)
        @user = user
        mail(to: '[email protected]', subject: 'New User Awaiting Admin Approval')



 def create
    @user =

    respond_to do |format|
        format.html { redirect_to @user, notice: 'User was successfully created.' }
        format.json { render :show, status: :created, location: @user }
        format.html { render :new }
        format.json { render json: @user.errors, status: :unprocessable_entity }

Real quick, you have your sendgrid PW in your config/envirnments/production.rb. You really should have that in your encyrpted credentails or a local ENV file otherwise it's going to (not might but going to) get stolen.

As far as the issue you're having, I cloned the repo and tried it out. It seems to work fine, an email is sent when a user registers. I even set up a local mail server to catch the emails being sent and was able to see them coming through.

I'm not sure what might be happening in Prod, I'm not that familiar with Heroku. But seems to work fine in Dev. Are you seeing the mail in your logs?

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 29,763+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.