Skip to content

Commit

Permalink
Test commit; Please ignore.
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCarlino committed Jun 22, 2019
1 parent 3d2c8aa commit c37f1de
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
class UserMailer < ApplicationMailer
NOTHING_TO_CONFIRM = "FAILED EMAIL CHANGE"
URI_KLASS = ENV["FORCE_SSL"] ? URI::HTTPS : URI::HTTP
URI_KLASS = ENV["FORCE_SSL"] ? URI::HTTPS : URI::HTTP

# Make sure the user gave us a valid email.
def welcome_email(user)
@user = user
@user = user
@user_name = user.name
@the_url = UserMailer.reset_url(user)
mail(to: @user.email, subject: 'Welcome to The FarmBot Web App!')
@the_url = UserMailer.reset_url(user)
mail(to: @user.email, subject: "Welcome to The FarmBot Web App!")
end

def password_reset(user, raw_token)
@user = user
url = UserMailer.url_object
url.path = "/password_reset/#{raw_token}"
@user = user
url = UserMailer.url_object
url.path = "/password_reset/#{raw_token}"
@password_reset_url = url.to_s
mail(to: @user.email, subject: 'FarmBot Password Reset Instructions')
mail(to: @user.email, subject: "FarmBot Password Reset Instructions")
end

# Much like welcome_email, it is used to check email validity.
# Triggered after the user tries update the `email` attr in Users#update.
def email_update(user)
raise NOTHING_TO_CONFIRM unless user.unconfirmed_email.present?
@user = user
@user = user
@the_url = UserMailer.reset_url(user)

mail(to: @user.unconfirmed_email,
subject: 'FarmBot Email Update Instructions')
mail(to: @user.unconfirmed_email,
subject: "FarmBot Email Update Instructions")
end

def self.reset_url(user)
Expand All @@ -36,7 +36,7 @@ def self.reset_url(user)
end

def self.url_object(host = ENV.fetch("API_HOST"), port = ENV.fetch("API_PORT"))
output = {}
output = {}
output[:host] = host
output[:port] = port unless [nil, "443", "80"].include?(port)
URI_KLASS.build(output)
Expand Down

0 comments on commit c37f1de

Please sign in to comment.