Added support of sender format.
This commit is contained in:
parent
21654d677c
commit
42bbb74bce
1 changed files with 9 additions and 1 deletions
|
@ -159,9 +159,16 @@ class Ticket < ActiveRecord::Base
|
|||
self.message_id = '<' + DateTime.current.to_s(:number) + '.' + self.ticket_id.to_s + '.' + rand(999999).to_s() + '@' + fqdn + '>'
|
||||
|
||||
# set sender
|
||||
if Setting.get('ticket_define_email_from') == 'AgentNameSystemAddressName'
|
||||
seperator = Setting.get('ticket_define_email_from_seperator')
|
||||
sender = User.find(self.created_by_id)
|
||||
system_sender = Setting.get('system_sender')
|
||||
self.from = "#{sender.firstname} #{sender.lastname} #{seperator} #{system_sender}"
|
||||
else
|
||||
self.from = Setting.get('system_sender')
|
||||
end
|
||||
end
|
||||
end
|
||||
def attachment_check
|
||||
|
||||
# do nothing if no attachment exists
|
||||
|
@ -182,6 +189,7 @@ class Ticket < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def communicate
|
||||
|
||||
# if sender is customer, do not communication
|
||||
sender = Ticket::Article::Sender.where( :id => self.ticket_article_sender_id ).first
|
||||
return 1 if sender == nil || sender['name'] == 'Customer'
|
||||
|
|
Loading…
Reference in a new issue