Improved error handling.

This commit is contained in:
Martin Edenhofer 2013-06-19 14:22:13 +02:00
parent b07e257ac5
commit ef71c4b2ec

View file

@ -32,6 +32,9 @@ class Observer::Ticket::Article::FillupFromEmail < ActiveRecord::Observer
# set sender # set sender
email_address = ticket.group.email_address email_address = ticket.group.email_address
if !email_address
raise "No email address found for group '#{ticket.group.name}'"
end
system_sender = "#{email_address.realname} <#{email_address.email}>" system_sender = "#{email_address.realname} <#{email_address.email}>"
if Setting.get('ticket_define_email_from') == 'AgentNameSystemAddressName' if Setting.get('ticket_define_email_from') == 'AgentNameSystemAddressName'
seperator = Setting.get('ticket_define_email_from_seperator') seperator = Setting.get('ticket_define_email_from_seperator')