Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- recipients = ""
- if job.status == "NEW" || job.status == "REVIEW"
- User.where(:role => "moderator").each do |user|
- recipients << user.email + ", "
- end
- end
- if job.status == "SENT" || job.status == "REJECTED"
- User.where(:role => "agency").each do |user|
- recipients << user.email + ", "
- end
- end
- if job.status == "DENIED" || job.status == "APPROVED"
- recipients << job.user.email
- end
- mail :to => recipients
Add Comment
Please, Sign In to add comment