Module: BlogComment::Notification

Defined in:
app/models/blog_comment.rb

Class Method Summary collapse

Class Method Details

.recipientsObject



88
89
90
91
92
93
94
# File 'app/models/blog_comment.rb', line 88

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

.recipients=(emails) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
# File 'app/models/blog_comment.rb', line 96

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

.subjectObject



109
110
111
112
113
114
# File 'app/models/blog_comment.rb', line 109

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

.subject=(subject_line) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
127
# File 'app/models/blog_comment.rb', line 116

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