diff options
| author | Xinhui | 2017-07-20 14:44:24 +0200 |
|---|---|---|
| committer | Xinhui | 2017-07-20 14:44:24 +0200 |
| commit | 91bfabc3b46973409de4279063804e0edaea1c27 (patch) | |
| tree | de8885a8d82d5f44b75e2ab0cd3ab1871bad94c0 /app | |
| parent | 4fd4fa0fd24c9cd86161358f2e36cff64f3712d7 (diff) | |
| download | chouette-core-91bfabc3b46973409de4279063804e0edaea1c27.tar.bz2 | |
Fix SMTP to address not found for delayed job
Refs #2263
Diffstat (limited to 'app')
| -rw-r--r-- | app/mailers/calendar_mailer.rb | 10 | ||||
| -rw-r--r-- | app/models/calendar_observer.rb | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/app/mailers/calendar_mailer.rb b/app/mailers/calendar_mailer.rb index cc8175a07..e2a368c6c 100644 --- a/app/mailers/calendar_mailer.rb +++ b/app/mailers/calendar_mailer.rb @@ -1,11 +1,13 @@ class CalendarMailer < ApplicationMailer - def updated calendar, user - @calendar = calendar + def updated calendar_id, user_id + @calendar = Calendar.find(calendar_id) + user = User.find(user_id) mail to: user.email, subject: t('mailers.calendar_mailer.updated.subject') end - def created calendar, user - @calendar = calendar + def created calendar_id, user_id + @calendar = Calendar.find(calendar_id) + user = User.find(user_id) mail to: user.email, subject: t('mailers.calendar_mailer.created.subject') end end diff --git a/app/models/calendar_observer.rb b/app/models/calendar_observer.rb index 789805356..c81addff4 100644 --- a/app/models/calendar_observer.rb +++ b/app/models/calendar_observer.rb @@ -4,7 +4,7 @@ class CalendarObserver < ActiveRecord::Observer return unless calendar.shared User.with_organisation.each do |user| - MailerJob.perform_later('CalendarMailer', 'updated', [calendar, user]) + MailerJob.perform_later('CalendarMailer', 'updated', [calendar.id, user.id]) end end @@ -12,7 +12,7 @@ class CalendarObserver < ActiveRecord::Observer return unless calendar.shared User.with_organisation.each do |user| - MailerJob.perform_later('CalendarMailer', 'created', [calendar, user]) + MailerJob.perform_later('CalendarMailer', 'created', [calendar.id, user.id]) end end end |
