Module: MuckUsers::Models::MuckAccessCodeRequest

Extended by:
ActiveSupport::Concern
Defined in:
lib/muck-users/models/access_code_request.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#send_access_code(subject, message, expires_at) ⇒ Object



42
43
44
45
46
47
48
49
50
51
# File 'lib/muck-users/models/access_code_request.rb', line 42

def send_access_code(subject, message, expires_at)
  access_code = AccessCode.create!(:unlimited => false,
                                   :use_limit => 1,
                                   :uses => 0,
                                   :code => AccessCode.random_code,
                                   :expires_at => expires_at,
                                   :sent_to => self.email)
  UserMailer.access_code(self.email, subject, message, access_code.code).deliver
  success = AccessCodeRequest.mark_fullfilled([self])
end

#send_access_code_request_confirmObject



36
37
38
39
40
# File 'lib/muck-users/models/access_code_request.rb', line 36

def send_access_code_request_confirm
  if MuckUsers.configuration.send_access_code_request_confirm
    UserMailer.access_code_request_confirm(self.email).deliver
  end
end