Class: ActivationMailer

Inherits:
ActionMailer::Base
  • Object
show all
Includes:
ActionMailerUtil
Defined in:
app/models/activation_mailer.rb

Overview

アクティベーションメーラ

Constant Summary collapse

SubjectPrefix =
"[#{MultiAuth.application_name}] "
FromAddress =
MultiAuth.from_address

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_complete_for_credential_params(options) ⇒ Object

Raises:

  • (ArgumentError)


51
52
53
54
55
56
57
58
59
60
61
62
# File 'app/models/activation_mailer.rb', line 51

def self.create_complete_for_credential_params(options)
  options = options.dup
  recipients = options.delete(:recipients) || raise(ArgumentError)
  raise(ArgumentError) unless options.empty?

  return {
    :subject    => SubjectPrefix + "メールアドレス認証登録完了",
    :from       => FromAddress,
    :recipients => recipients,
    :body       => {},
  }
end

.create_complete_for_notice_params(options) ⇒ Object

Raises:

  • (ArgumentError)


78
79
80
81
82
83
84
85
86
87
88
89
# File 'app/models/activation_mailer.rb', line 78

def self.create_complete_for_notice_params(options)
  options = options.dup
  recipients = options.delete(:recipients) || raise(ArgumentError)
  raise(ArgumentError) unless options.empty?

  return {
    :subject    => SubjectPrefix + "通知先メールアドレス登録完了",
    :from       => FromAddress,
    :recipients => recipients,
    :body       => {},
  }
end

.create_complete_for_signup_params(options) ⇒ Object

Raises:

  • (ArgumentError)


24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/activation_mailer.rb', line 24

def self.(options)
  options = options.dup
  recipients = options.delete(:recipients) || raise(ArgumentError)
  raise(ArgumentError) unless options.empty?

  return {
    :subject    => SubjectPrefix + "ユーザ登録完了",
    :from       => FromAddress,
    :recipients => recipients,
    :body       => {},
  }
end

.create_request_for_credential_params(options) ⇒ Object

Raises:

  • (ArgumentError)


37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'app/models/activation_mailer.rb', line 37

def self.create_request_for_credential_params(options)
  options = options.dup
  recipients     = options.delete(:recipients)     || raise(ArgumentError)
  activation_url = options.delete(:activation_url) || raise(ArgumentError)
  raise(ArgumentError) unless options.empty?

  return {
    :subject    => SubjectPrefix + "メールアドレス認証登録",
    :from       => FromAddress,
    :recipients => recipients,
    :body       => {:activation_url => activation_url},
  }
end

.create_request_for_notice_params(options) ⇒ Object

Raises:

  • (ArgumentError)


64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'app/models/activation_mailer.rb', line 64

def self.create_request_for_notice_params(options)
  options = options.dup
  recipients     = options.delete(:recipients)     || raise(ArgumentError)
  activation_url = options.delete(:activation_url) || raise(ArgumentError)
  raise(ArgumentError) unless options.empty?

  return {
    :subject    => SubjectPrefix + "通知先メールアドレス登録",
    :from       => FromAddress,
    :recipients => recipients,
    :body       => {:activation_url => activation_url},
  }
end

.create_request_for_signup_params(options) ⇒ Object

Raises:

  • (ArgumentError)


10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/models/activation_mailer.rb', line 10

def self.(options)
  options = options.dup
  recipients     = options.delete(:recipients)     || raise(ArgumentError)
  activation_url = options.delete(:activation_url) || raise(ArgumentError)
  raise(ArgumentError) unless options.empty?

  return {
    :subject    => SubjectPrefix + "ユーザ登録",
    :from       => FromAddress,
    :recipients => recipients,
    :body       => {:activation_url => activation_url},
  }
end

Instance Method Details

#complete_for_credential(options) ⇒ Object



103
104
105
# File 'app/models/activation_mailer.rb', line 103

def complete_for_credential(options)
  build_message(self.class.create_complete_for_credential_params(options))
end

#complete_for_notice(options) ⇒ Object



111
112
113
# File 'app/models/activation_mailer.rb', line 111

def complete_for_notice(options)
  build_message(self.class.create_complete_for_notice_params(options))
end

#complete_for_signup(options) ⇒ Object



95
96
97
# File 'app/models/activation_mailer.rb', line 95

def (options)
  build_message(self.class.(options))
end

#request_for_credential(options) ⇒ Object



99
100
101
# File 'app/models/activation_mailer.rb', line 99

def request_for_credential(options)
  build_message(self.class.create_request_for_credential_params(options))
end

#request_for_notice(options) ⇒ Object



107
108
109
# File 'app/models/activation_mailer.rb', line 107

def request_for_notice(options)
  build_message(self.class.create_request_for_notice_params(options))
end

#request_for_signup(options) ⇒ Object



91
92
93
# File 'app/models/activation_mailer.rb', line 91

def (options)
  build_message(self.class.(options))
end