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>
{{#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">
<label>{{i18n "admin.email.incoming_emails.modal.message_id"}}</label>
<label>{{i18n "admin.email.incoming_emails.modal.headers"}}</label>
<div class="controls">
{{model.message_id}}
{{textarea value=model.headers wrap="off"}}
</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">
<label>{{i18n "admin.email.incoming_emails.modal.subject"}}</label>
<div class="controls">

View File

@ -3,14 +3,7 @@ class IncomingEmailDetailsSerializer < ApplicationSerializer
attributes :error,
:error_description,
:rejection_message,
:return_path,
:date,
:from,
:to,
:cc,
:message_id,
:references,
:in_reply_to,
:headers,
:subject,
:body
@ -35,38 +28,8 @@ class IncomingEmailDetailsSerializer < ApplicationSerializer
@error_string[EMAIL_RECEIVER_ERROR_PREFIX]
end
def return_path
@mail.return_path
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
def headers
@mail.header.to_s
end
def subject

View File

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