Fixed not needed html encoding in subject of html emails.

This commit is contained in:
Martin Edenhofer 2015-01-22 08:17:06 +01:00
parent aa51a9a5dc
commit 0e03e6d216
2 changed files with 25 additions and 3 deletions

View file

@ -292,7 +292,7 @@ State: i18n(#{ticket.state.name.text2html})<br>
<br>'
end
if user.preferences[:locale] =~ /^de/i
subject = 'Ticket aktualisiert (#{ticket.title.text2html})'
subject = 'Ticket aktualisiert (#{ticket.title})'
body = '<div>Hallo #{recipient.firstname.text2html},</div>
<br>
<div>
@ -309,7 +309,7 @@ Ticket (#{ticket.title.text2html}) wurde von "<b>#{ticket.updated_by.fullname.te
</div>
'
else
subject = 'Updated Ticket (#{ticket.title.text2html})'
subject = 'Updated Ticket (#{ticket.title})'
body = '<div>Hi #{recipient.firstname.text2html},</div>
<br>
<div>

View file

@ -364,7 +364,7 @@ class TicketNotificationTest < ActiveSupport::TestCase
# create ticket in group
ticket1 = Ticket.create(
:title => 'some notification template test 1',
:title => 'some notification template test 1 Bobs\'s resumé',
:group => Group.lookup( :name => 'Users'),
:customer => customer,
:state => Ticket::State.lookup( :name => 'new' ),
@ -413,6 +413,16 @@ class TicketNotificationTest < ActiveSupport::TestCase
assert_match( /updated/i, template[:subject] )
# en notification
subject = NotificationFactory.build(
:locale => agent2.preferences[:locale],
:string => template[:subject],
:objects => {
:ticket => ticket1,
:article => article,
:recipient => agent2,
}
)
assert_match( /Bobs's resumé/, subject )
body = NotificationFactory.build(
:locale => agent2.preferences[:locale],
:string => template[:body],
@ -430,6 +440,8 @@ class TicketNotificationTest < ActiveSupport::TestCase
# de template
template = bg.template_update(agent1, ticket1, article, human_changes)
assert( template[:subject] )
assert( template[:subject] )
assert_match( /Bobs's resumé/, template[:subject] )
assert( template[:body] )
assert_match( /Priority/, template[:body] )
assert_match( /1 low/, template[:body] )
@ -437,6 +449,16 @@ class TicketNotificationTest < ActiveSupport::TestCase
assert_match( /aktualis/, template[:subject] )
# de notification
subject = NotificationFactory.build(
:locale => agent1.preferences[:locale],
:string => template[:subject],
:objects => {
:ticket => ticket1,
:article => article,
:recipient => agent2,
}
)
assert_match( /Bobs's resumé/, subject )
body = NotificationFactory.build(
:locale => agent1.preferences[:locale],
:string => template[:body],