mirror of
https://github.com/cytopia/devilbox.git
synced 2025-02-21 01:42:14 +00:00
fix: show utf-8 mail body properly
This commit is contained in:
parent
23a6aed10d
commit
bfb4769e85
@ -4,8 +4,9 @@ class HtmlEmail extends HTMLElement {
|
||||
this.attachShadow({ mode: 'open' });
|
||||
|
||||
let emailContent;
|
||||
const templateId = this.dataset.templateId;
|
||||
try {
|
||||
emailContent = window.atob(this.dataset.content);
|
||||
emailContent = document.getElementById(templateId).innerHTML;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return;
|
||||
|
@ -186,8 +186,8 @@ $messages = $MyMbox->get($sortOrderArr);
|
||||
<td></td>
|
||||
<td colspan="4">
|
||||
<?php if ($body !== null): ?>
|
||||
<html-email data-content="<?php echo base64_encode($body) ?>">
|
||||
</html-email>
|
||||
<template id="mail-body-<?=$data['num']?>"><?=$body?></template>
|
||||
<html-email data-template-id="mail-body-<?=$data['num']?>"></html-email>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
No valid body found
|
||||
@ -213,12 +213,9 @@ $messages = $MyMbox->get($sortOrderArr);
|
||||
<?php echo loadClass('Html')->getFooter(); ?>
|
||||
<script>
|
||||
$(function() {
|
||||
$('.subject').each(function() {
|
||||
$(this).click(function() {
|
||||
var id = ($(this).attr('id'));
|
||||
$('#mail-'+id).toggle();
|
||||
|
||||
})
|
||||
$('.subject').click(function() {
|
||||
var id = ($(this).attr('id'));
|
||||
$('#mail-'+id).toggle();
|
||||
})
|
||||
// Handler for .ready() called.
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user