Followup for issue#719 - ensure that title is set even via email creation.
This commit is contained in:
parent
c1d663e4e4
commit
e1059d4ece
2 changed files with 52 additions and 3 deletions
|
@ -512,9 +512,13 @@ returns
|
||||||
if !group
|
if !group
|
||||||
group = Group.first
|
group = Group.first
|
||||||
end
|
end
|
||||||
|
title = mail[:subject]
|
||||||
|
if title.blank?
|
||||||
|
title = '-'
|
||||||
|
end
|
||||||
ticket = Ticket.new(
|
ticket = Ticket.new(
|
||||||
group_id: group.id,
|
group_id: group.id,
|
||||||
title: mail[:subject] || '',
|
title: title,
|
||||||
preferences: preferences,
|
preferences: preferences,
|
||||||
)
|
)
|
||||||
set_attributes_by_x_headers(ticket, 'ticket', mail)
|
set_attributes_by_x_headers(ticket, 'ticket', mail)
|
||||||
|
|
|
@ -72,6 +72,51 @@ Some Textäöü",
|
||||||
{
|
{
|
||||||
data: "From: me@example.com
|
data: "From: me@example.com
|
||||||
To: customer@example.com
|
To: customer@example.com
|
||||||
|
Subject:
|
||||||
|
|
||||||
|
Some Textäöü without subject#1",
|
||||||
|
channel: {
|
||||||
|
trusted: false,
|
||||||
|
},
|
||||||
|
success: true,
|
||||||
|
result: {
|
||||||
|
0 => {
|
||||||
|
priority: '2 normal',
|
||||||
|
title: '-',
|
||||||
|
},
|
||||||
|
1 => {
|
||||||
|
body: 'Some Textäöü without subject#1',
|
||||||
|
sender: 'Customer',
|
||||||
|
type: 'email',
|
||||||
|
internal: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: "From: me@example.com
|
||||||
|
To: customer@example.com
|
||||||
|
|
||||||
|
Some Textäöü without subject#2",
|
||||||
|
channel: {
|
||||||
|
trusted: false,
|
||||||
|
},
|
||||||
|
success: true,
|
||||||
|
result: {
|
||||||
|
0 => {
|
||||||
|
priority: '2 normal',
|
||||||
|
title: '-',
|
||||||
|
},
|
||||||
|
1 => {
|
||||||
|
body: 'Some Textäöü without subject#2',
|
||||||
|
sender: 'Customer',
|
||||||
|
type: 'email',
|
||||||
|
internal: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: "From: me@example.com
|
||||||
|
To: customer@example.com
|
||||||
Subject: äöü some subject
|
Subject: äöü some subject
|
||||||
|
|
||||||
Some Textäöü".encode('ISO-8859-1'),
|
Some Textäöü".encode('ISO-8859-1'),
|
||||||
|
@ -79,7 +124,7 @@ Some Textäöü".encode('ISO-8859-1'),
|
||||||
result: {
|
result: {
|
||||||
0 => {
|
0 => {
|
||||||
priority: '2 normal',
|
priority: '2 normal',
|
||||||
title: '', # should be äöü some subject, but can not be parsed from mime tools
|
title: '-', # should be äöü some subject, but can not be parsed from mime tools
|
||||||
},
|
},
|
||||||
1 => {
|
1 => {
|
||||||
body: 'Some Textäöü',
|
body: 'Some Textäöü',
|
||||||
|
@ -206,7 +251,7 @@ Some Text",
|
||||||
result: {
|
result: {
|
||||||
0 => {
|
0 => {
|
||||||
priority: '2 normal',
|
priority: '2 normal',
|
||||||
title: '',
|
title: '-',
|
||||||
},
|
},
|
||||||
1 => {
|
1 => {
|
||||||
from: 'marketingmanager@nthcpghana.com',
|
from: 'marketingmanager@nthcpghana.com',
|
||||||
|
|
Loading…
Reference in a new issue