Everything passes without errors, but not a single letter came to the post office. User logs
environment.rb
# environment.rb # Load the Rails application. require File.expand_path('../application', __FILE__) # Initialize the Rails application. Rails.application.initialize! ActionMailer::Base.smtp_settings = { user_name: 'your_sendgrid_username', password: 'your_sendgrid_password', domain: 'yourdomain.com', address: 'smtp.sendgrid.net', port: 587, authentication: :plain, enable_starttls_auto: true } user_mailer.rb
class UserMailer < ApplicationMailer default from: 'notifications@example.com' def welcome_email(user) @user = user @url = 'http://example.com/login' mail(to: @user.email, subject: 'Welcome to My Awesome Site') end end users_contoller.rb
class UsersController < ApplicationController def index @users = User.all end def new @user = User.new end def create @user = User.new(user_params) if @user.save UserMailer.welcome_email(@user).deliver session[:current_user_id] = @user.token redirect_to root_path else render :new end end private def user_params params.require(:user).permit(:email, :password, :first_name, :last_name, :login) end end user_mailer / welcome_email.thml.slim
doctype html html head meta content='text/html; charset=UTF-8' http-equiv='Content-Type' body Welcome to example.com, = @user.name p You have successfully signed up to example.com, your username is: = @user.login p To login to the site, just follow this link: = @url p Thanks for joining and have a great day!
Unpermitted parameter: password_confirmation,DEPRECATION WARNINGandSent mail to aaa73731919@gmail.com. The problem, apparently, is only with the last: the letter has gone, but where? .. - D-side