design changes
parent
73ee254ef7
commit
4087fe13a8
|
@ -36,7 +36,7 @@ router.get(
|
|||
// Emails are immutable, cache if found
|
||||
res.set('Cache-Control', 'private, max-age=600')
|
||||
res.render('mail', {
|
||||
title: req.params.address,
|
||||
title: mail.subject + " | " + req.params.address,
|
||||
address: req.params.address,
|
||||
mail,
|
||||
uid: req.params.uid,
|
||||
|
@ -62,7 +62,7 @@ router.get(
|
|||
)
|
||||
|
||||
router.get(
|
||||
'^/:address/:uid([0-9]+$)/delete',
|
||||
'^/:address/:uid/delete',
|
||||
sanitizeAddress,
|
||||
async (req, res, next) => {
|
||||
try {
|
||||
|
@ -76,4 +76,40 @@ router.get(
|
|||
}
|
||||
)
|
||||
|
||||
router.get(
|
||||
'^/:address/:uid/raw',
|
||||
sanitizeAddress,
|
||||
async (req, res, next) => {
|
||||
try {
|
||||
const mailProcessingService = req.app.get('mailProcessingService')
|
||||
const mail = await mailProcessingService.getOneFullMail(
|
||||
req.params.address,
|
||||
req.params.uid
|
||||
)
|
||||
if (mail && mail != "womp womp") {
|
||||
// Emails are immutable, cache if found
|
||||
res.set('Cache-Control', 'private, max-age=600')
|
||||
res.render('raw', {
|
||||
title: mail.subject + " | raw | " + req.params.address,
|
||||
mail
|
||||
})
|
||||
} else {
|
||||
res.render(
|
||||
'error',
|
||||
{
|
||||
address: req.params.address,
|
||||
message: 'This mail could not be found. It either does not exist or has been deleted from our servers!',
|
||||
madeby: config.http.branding[1],
|
||||
madebysite: config.http.branding[2],
|
||||
}
|
||||
)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('error while fetching one email', error)
|
||||
next(error)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
module.exports = router
|
||||
|
|
|
@ -13,8 +13,13 @@
|
|||
Logout</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div style="text-align: center;">
|
||||
<h1>{{ mail.subject }}</h1>
|
||||
<div class="mail_body" style="padding-left:10%;">
|
||||
<h1 style="text-align:left;">
|
||||
{{ mail.subject }}
|
||||
<span style="float:right; padding-right:10vw;" >
|
||||
From: {{ mail.from.text }} at {{ mail.date| date }}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
{% if mail.html %}
|
||||
<div>
|
||||
|
@ -48,8 +53,4 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<h3 style="text-align: center;display: block;">{{ mail.from.text }} | {{ mail.date| date }}</h3>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue