class UserMailer < ApplicationMailer
  default from: 'thomas.alcala@gmail.com'

  def new_registration_email(user)
    @user = user
    #@email = ERB::Util.url_encode(@user.email)
    #@url = "http://tomalcala.com/users/#{@email}/confirm/#{@user.notes}"
    @url = confirm_user_path(@user, @user.notes)
    mail(to: @user.email, subject: 'Your registration to TomAlcala.com')
  end

  def new_registration_email_admin(user)
    @user = user
    mail(to: User.find(1).email, subject: 'New registration to TomAlcala.com')
  end
end
