show all headers in rejected email details modal

This commit is contained in:
Régis Hanol 2016-03-30 19:05:42 +02:00
parent 6c82fbebf5
commit 2ac38e9d05
3 changed files with 6 additions and 115 deletions

View File

@ -10,78 +10,13 @@
<hr> <hr>
{{#if model.return_path}}
<div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.return_path"}}</label>
<div class="controls">
{{model.return_path}}
</div>
</div>
{{/if}}
<div class="control-group"> <div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.message_id"}}</label> <label>{{i18n "admin.email.incoming_emails.modal.headers"}}</label>
<div class="controls"> <div class="controls">
{{model.message_id}} {{textarea value=model.headers wrap="off"}}
</div> </div>
</div> </div>
{{#if model.references}}
<div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.references"}}</label>
<div class="controls">
<ul>
{{#each reference in model.references}}
<li>{{reference}}</li>
{{/each}}
</ul>
</div>
</div>
{{/if}}
{{#if model.in_reply_to}}
<div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.in_reply_to"}}</label>
<div class="controls">
{{model.in_reply_to}}
</div>
</div>
{{/if}}
<div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.date"}}</label>
<div class="controls">
{{date}}
</div>
</div>
<div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.from"}}</label>
<div class="controls">
{{model.from}}
</div>
</div>
<div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.to"}}</label>
<div class="controls">
<ul>
{{#each to in model.to}}
<li>{{to}}</li>
{{/each}}
</ul>
</div>
</div>
{{#if model.cc}}
<div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.cc"}}</label>
<div class="controls">
{{model.cc}}
</div>
</div>
{{/if}}
<div class="control-group"> <div class="control-group">
<label>{{i18n "admin.email.incoming_emails.modal.subject"}}</label> <label>{{i18n "admin.email.incoming_emails.modal.subject"}}</label>
<div class="controls"> <div class="controls">

View File

@ -3,14 +3,7 @@ class IncomingEmailDetailsSerializer < ApplicationSerializer
attributes :error, attributes :error,
:error_description, :error_description,
:rejection_message, :rejection_message,
:return_path, :headers,
:date,
:from,
:to,
:cc,
:message_id,
:references,
:in_reply_to,
:subject, :subject,
:body :body
@ -35,38 +28,8 @@ class IncomingEmailDetailsSerializer < ApplicationSerializer
@error_string[EMAIL_RECEIVER_ERROR_PREFIX] @error_string[EMAIL_RECEIVER_ERROR_PREFIX]
end end
def return_path def headers
@mail.return_path @mail.header.to_s
end
def date
@mail.date
end
def from
@mail.from.first.downcase
end
def to
@mail.to.map(&:downcase)
end
def cc
@mail.cc.map(&:downcase) if @mail.cc.present?
end
def message_id
@mail.message_id
end
def references
references = Email::Receiver.extract_references(@mail.references)
references.delete(@mail.in_reply_to) if references
references
end
def in_reply_to
@mail.in_reply_to
end end
def subject def subject

View File

@ -2318,14 +2318,7 @@ en:
modal: modal:
title: "Incoming Email Details" title: "Incoming Email Details"
error: "Error" error: "Error"
return_path: "Return-Path" headers: "Headers"
message_id: "Message-Id"
in_reply_to: "In-Reply-To"
references: "References"
date: "Date"
from: "From"
to: "To"
cc: "Cc"
subject: "Subject" subject: "Subject"
body: "Body" body: "Body"
rejection_message: "Rejection Mail" rejection_message: "Rejection Mail"