Don't send an email for a topic that has been deleted

This commit is contained in:
Neil Lalonde 2013-04-23 13:10:11 -04:00
parent 06e5083950
commit 2e8e4b7c6e
1 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,11 @@ module Jobs
return if seen_recently
# Load the post if present
email_args[:post] ||= notification.post if notification.post.present?
if notification.post.present?
# Don't email a user if the topic has been deleted
return unless notification.post.topic.present?
email_args[:post] ||= notification.post
end
email_args[:notification] = notification
# Don't send email if the notification this email is about has already been read