Commit 366eba58049b36b00df38d64396278095d35066f
1 parent
9c61af94
Exists in
master
and in
29 other branches
Fix mail sending at send_notification method
Showing
7 changed files
with
13 additions
and
15 deletions
Show diff stats
app/controllers/public/account_controller.rb
... | ... | @@ -193,7 +193,7 @@ class AccountController < ApplicationController |
193 | 193 | else |
194 | 194 | @change_password.errors[:base] << _('Could not find any user with %s equal to "%s".') % [fields_label, params[:value]] |
195 | 195 | end |
196 | - rescue ActiveRecord::RecordInvald | |
196 | + rescue ActiveRecord::RecordInvalid | |
197 | 197 | @change_password.errors[:base] << _('Could not perform password recovery for the user.') |
198 | 198 | end |
199 | 199 | end | ... | ... |
app/models/task.rb
... | ... | @@ -285,8 +285,9 @@ class Task < ActiveRecord::Base |
285 | 285 | # If |
286 | 286 | def send_notification(action) |
287 | 287 | if sends_email? |
288 | - if self.requestor | |
289 | - TaskMailer.generic_message("task_#{action}", self) | |
288 | + if self.requestor && !self.requestor.notification_emails.empty? | |
289 | + message = TaskMailer.generic_message("task_#{action}", self) | |
290 | + message.deliver if message | |
290 | 291 | end |
291 | 292 | end |
292 | 293 | end | ... | ... |
app/views/task_mailer/task_activated.text.erb
app/views/task_mailer/task_cancelled.text.erb
app/views/task_mailer/task_created.text.erb
app/views/task_mailer/task_finished.text.erb