Improved visualisation of delivery failed message.

This commit is contained in:
Martin Edenhofer 2016-06-27 14:09:34 +02:00
parent 8b9d917a1e
commit 24eae3104e
5 changed files with 21 additions and 10 deletions

View file

@ -117,7 +117,14 @@ class ArticleViewItem extends App.ObserverController
article['html'] = App.Utils.text2html(body)
article['html'] = article['html'].replace(signatureDetected, '<span class="js-signatureMarker"></span>')
if article.sender.name is 'System' && !article.preferences.delivery_message
if article.preferences.delivery_message
@html App.view('ticket_zoom/article_view_delivery_failed')(
ticket: @ticket
article: article
isCustomer: @isRole('Customer')
)
return
if article.sender.name is 'System'
#if article.sender.name is 'System' && article.preferences.perform_origin is 'trigger'
@html App.view('ticket_zoom/article_view_system')(
ticket: @ticket

View file

@ -0,0 +1,7 @@
<div class="article-meta-clip"></div>
<div class="article-content">
<div class="small task-subline alert alert--warning">
<%- @T('Delivery failed') %>: "<%= @article.body %>"
</div>
</div>
<div class="article-meta-clip"></div>

View file

@ -23,9 +23,9 @@ class Observer::Ticket::Article::CommunicateEmail::BackgroundJob
# send email
if !ticket.group.email_address_id
log_error(record, "Unable to send email, no email address definde for group id '#{ticket.group.id}'")
log_error(record, "No email address definde for group id '#{ticket.group.id}'!")
elsif !ticket.group.email_address.channel_id
log_error(record, "Unable to send email, no channel definde for email_address id '#{ticket.group.email_address_id}'")
log_error(record, "No channel definde for email_address id '#{ticket.group.email_address_id}'!")
end
channel = ticket.group.email_address.channel
@ -129,7 +129,7 @@ class Observer::Ticket::Article::CommunicateEmail::BackgroundJob
Ticket::Article.create(
ticket_id: local_record.ticket_id,
content_type: 'text/plain',
body: "Unable to send email to '#{recipient_list}'\n#{message}",
body: "Unable to send email to '#{recipient_list}': #{message}",
internal: true,
sender: Ticket::Article::Sender.find_by(name: 'System'),
type: Ticket::Article::Type.find_by(name: 'note'),
@ -140,7 +140,6 @@ class Observer::Ticket::Article::CommunicateEmail::BackgroundJob
updated_by_id: 1,
created_by_id: 1,
)
return
end
raise message

View file

@ -46,7 +46,7 @@ class Observer::Ticket::Article::CommunicateFacebook::BackgroundJob
end
if !post
log_error(article, 'Unable to send message to facebook')
log_error(article, 'Got no post!')
return
end
@ -73,7 +73,7 @@ class Observer::Ticket::Article::CommunicateFacebook::BackgroundJob
Ticket::Article.create(
ticket_id: local_record.ticket_id,
content_type: 'text/plain',
body: "Unable to send tweet: #{message}",
body: "Unable to send post: #{message}",
internal: true,
sender: Ticket::Article::Sender.find_by(name: 'System'),
type: Ticket::Article::Type.find_by(name: 'note'),
@ -84,7 +84,6 @@ class Observer::Ticket::Article::CommunicateFacebook::BackgroundJob
updated_by_id: 1,
created_by_id: 1,
)
return
end
raise message

View file

@ -31,7 +31,7 @@ class Observer::Ticket::Article::CommunicateTwitter::BackgroundJob
return
end
if !tweet
log_error(article, 'Unable to send message to twitter')
log_error(article, 'Got no tweet!')
return
end
@ -94,7 +94,6 @@ class Observer::Ticket::Article::CommunicateTwitter::BackgroundJob
updated_by_id: 1,
created_by_id: 1,
)
return
end
raise message