Module: WhatsonComment::Notification

Defined in:
app/models/whatson_comment.rb

Class Method Summary collapse

Class Method Details

.recipientsObject



94
95
96
97
98
99
100
# File 'app/models/whatson_comment.rb', line 94

def recipients
  RefinerySetting.find_or_set(:comment_notification_recipients, (Role[:refinery].users.first.email rescue ''),
  {
    :scoping => 'whatson',
    :restricted => false
  })
end

.recipients=(emails) ⇒ Object



102
103
104
105
106
107
108
109
110
111
112
113
# File 'app/models/whatson_comment.rb', line 102

def recipients=(emails)
  new_value = {
    :value => emails,
    :scoping => 'whatson',
    :restricted => false
  }
  if RefinerySetting.respond_to?(:set)
    RefinerySetting.set(:comment_notification_recipients, new_value)
  else
    RefinerySetting[:comment_notification_recipients] = new_value
  end
end

.subjectObject



115
116
117
118
119
120
# File 'app/models/whatson_comment.rb', line 115

def subject
  RefinerySetting.find_or_set(:comment_notification_subject, "New inquiry from your website", {
    :scoping => 'whatson',
    :restricted => false
  })
end

.subject=(subject_line) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
133
# File 'app/models/whatson_comment.rb', line 122

def subject=(subject_line)
  new_value = {
    :value => subject_line,
    :scoping => 'whatson',
    :restricted => false
  }
  if RefinerySetting.respond_to?(:set)
    RefinerySetting.set(:comment_notification_subject, new_value)
  else
    RefinerySetting[:comment_notification_subject] = new_value
  end
end