class UserMailer < ApplicationMailer before_action :load_params def welcome_email mail(to: @user.email, subject: "Welcome to #{@service_name}") end def invite_email @accept_path = params[:accept_path] mail(to: @user.email, subject: "Invite to #{@service_name}") end def load_params @user = User.find(params[:user_id]) @invited_by = User.find_by(uid: params[:invited_by_uid]) @service_name = Rails.configuration.name @service_url = Rails.configuration.host_url end end