Ask A Question


You’re not receiving notifications from this thread.

Sending emails not working, no errors found in the terminal

Felix Pujols asked in General

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: ''
      layout 'mailer'

      def new_user_waiting_for_approval(user)
        @user = user
        mail(to: '', 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?

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,038+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.