Merge branch 'private-issue1996-reply-recipient' into develop
This commit is contained in:
commit
ee20aa2a12
2 changed files with 42 additions and 1 deletions
|
@ -994,7 +994,9 @@ class App.Utils
|
||||||
if !_.isEmpty(article.to)
|
if !_.isEmpty(article.to)
|
||||||
recipients = App.Utils.parseAddressListLocal(article.to)
|
recipients = App.Utils.parseAddressListLocal(article.to)
|
||||||
if recipients && recipients[0]
|
if recipients && recipients[0]
|
||||||
recipientIsLocal = isLocalAddress(recipients[0])
|
for localRecipient in recipients
|
||||||
|
recipientIsLocal = isLocalAddress(localRecipient)
|
||||||
|
break if recipientIsLocal is true
|
||||||
|
|
||||||
# sender is local
|
# sender is local
|
||||||
if senderIsLocal
|
if senderIsLocal
|
||||||
|
|
|
@ -2603,6 +2603,45 @@ test('check getRecipientArticle format', function() {
|
||||||
verify = App.Utils.getRecipientArticle(ticket, article, agent, article.type, email_addresses, false)
|
verify = App.Utils.getRecipientArticle(ticket, article, agent, article.type, email_addresses, false)
|
||||||
deepEqual(verify, result)
|
deepEqual(verify, result)
|
||||||
|
|
||||||
|
agent = {
|
||||||
|
login: 'login',
|
||||||
|
firstname: 'firstname',
|
||||||
|
lastname: 'lastname',
|
||||||
|
email: 'agent@example.com',
|
||||||
|
}
|
||||||
|
ticket = {
|
||||||
|
customer: agent,
|
||||||
|
}
|
||||||
|
article = {
|
||||||
|
message_id: 'message_id20',
|
||||||
|
created_by: agent,
|
||||||
|
type: {
|
||||||
|
name: 'email',
|
||||||
|
},
|
||||||
|
sender: {
|
||||||
|
name: 'Agent',
|
||||||
|
},
|
||||||
|
from: 'Agent <Agent@Example.com>',
|
||||||
|
to: 'somebodyelse@example.com, Zammad <zammad@example.com>',
|
||||||
|
cc: '',
|
||||||
|
}
|
||||||
|
result = {
|
||||||
|
to: 'agent@example.com',
|
||||||
|
cc: '',
|
||||||
|
body: '',
|
||||||
|
in_reply_to: 'message_id20',
|
||||||
|
}
|
||||||
|
email_addresses = [
|
||||||
|
{
|
||||||
|
email: 'zammad@example.com',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
email: 'zammad2@example.com',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
verify = App.Utils.getRecipientArticle(ticket, article, agent, article.type, email_addresses, false)
|
||||||
|
deepEqual(verify, result)
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue