Commit 3814a76e88ae27f4c1f72ce442dc59c807dc5e3e
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'fix_notification_mail' into stable
Conflicts: app/models/task.rb
Showing
6 changed files
with
12 additions
and
15 deletions
Show diff stats
app/models/task.rb
| @@ -285,8 +285,9 @@ class Task < ActiveRecord::Base | @@ -285,8 +285,9 @@ class Task < ActiveRecord::Base | ||
| 285 | # If | 285 | # If |
| 286 | def send_notification(action) | 286 | def send_notification(action) |
| 287 | if sends_email? | 287 | if sends_email? |
| 288 | - if self.requestor | ||
| 289 | - TaskMailer.generic_message("task_#{action}", self).deliver | 288 | + if self.requestor && !self.requestor.notification_emails.empty? |
| 289 | + message = TaskMailer.generic_message("task_#{action}", self) | ||
| 290 | + message.deliver if message | ||
| 290 | end | 291 | end |
| 291 | end | 292 | end |
| 292 | end | 293 | end |
app/views/task_mailer/generic_message.text.erb
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