module InfinumId class Mailer < InfinumId::ApplicationMailer before_action :load_params def welcome_email mail(to: @resource.email, subject: "Welcome to #{@service_name}") end def invite_email @accept_path = params[:accept_path] mail(to: @resource.email, subject: "Invite to #{@service_name}") end def load_params @resource = resource_class.find(params[:resource_id]) @invited_by = resource_class.find_by(uid: params[:invited_by_uid]) @service_name = InfinumId.service_name @service_url = Rails.configuration.host_url end delegate :resource_name, :resource_class, to: InfinumId end end