Add subject to email log
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 15 Feb 2021 13:58:50 +0000 (14:58 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 18 Feb 2021 15:25:20 +0000 (16:25 +0100)
wcfsetup/install/files/acp/templates/emailLogList.tpl
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_db.php
wcfsetup/install/files/lib/system/background/job/EmailDeliveryBackgroundJob.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml
wcfsetup/setup/db/install.sql

index 51cc014cacb2dc414d227d915785734d26b37c0a..231ce7b907aaf6f216f62030f80dcf854b21f582 100644 (file)
@@ -28,7 +28,7 @@
                        <thead>
                                <tr>
                                        <th class="columnID columnEntryID{if $sortField == 'entryID'} active {@$sortOrder}{/if}"><a href="{link controller='EmailLogList'}pageNo={@$pageNo}&sortField=entryID&sortOrder={if $sortField == 'entryID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
-                                       <th class="columnTitle columnMessageID{if $sortField == 'messageID'} active {@$sortOrder}{/if}">{lang}wcf.acp.email.log.messageID{/lang}</th>
+                                       <th class="columnTitle columnSubject{if $sortField == 'subject'} active {@$sortOrder}{/if}">{lang}wcf.acp.email.log.subject{/lang}</th>
                                        <th class="columnText columnRecipient{if $sortField == 'recipient'} active {@$sortOrder}{/if}">{lang}wcf.user.email{/lang}</th>
                                        <th class="columnDate columnTime{if $sortField == 'time'} active {@$sortOrder}{/if}"><a href="{link controller='EmailLogList'}pageNo={@$pageNo}&sortField=time&sortOrder={if $sortField == 'execTime' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.email.log.time{/lang}</a></th>
                                        <th class="columnText columnStatusMessage{if $sortField == 'status'} active {@$sortOrder}{/if}"><a href="{link controller='EmailLogList'}pageNo={@$pageNo}&sortField=status&sortOrder={if $sortField == 'success' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.email.log.status{/lang}</a></th>
@@ -42,7 +42,8 @@
                                        <tr class="jsEmailLogEntry">
                                                <td class="columnID columnEntryID">{@$entry->entryID}</td>
                                                <td class="columnTitle columnMessageID">
-                                                       <kbd title="{$entry->messageID}">{$entry->getFormattedMessageId()|truncate:50}</kbd>
+                                                       {$entry->subject}<br>
+                                                       <small><kbd title="{$entry->messageID}">{$entry->getFormattedMessageId()|truncate:50}</kbd></small>
                                                </td>
                                                <td class="columnText columnRecipient">
                                                        {if $__wcf->session->getPermission('admin.user.canEditMailAddress')}
index 7809379b5555909cfcd7a4370f06142afdea8f48..36a2784b887862f46bd50fb762fd48858bc26690 100644 (file)
@@ -35,6 +35,7 @@ $tables = [
             ObjectIdDatabaseTableColumn::create('entryID'),
             NotNullInt10DatabaseTableColumn::create('time'),
             NotNullVarchar255DatabaseTableColumn::create('messageID'),
+            NotNullVarchar255DatabaseTableColumn::create('subject'),
             NotNullVarchar255DatabaseTableColumn::create('recipient'),
             IntDatabaseTableColumn::create('recipientID')
                 ->length(10)
index 4718361624ac1c755c877e09d70916f39e03c816..9307d1d5e9043bb4a0f0a00ea1c89c625b5bea74 100644 (file)
@@ -9,6 +9,7 @@ use wcf\system\email\Mailbox;
 use wcf\system\email\transport\exception\PermanentFailure;
 use wcf\system\email\transport\IStatusReportingEmailTransport;
 use wcf\system\email\UserMailbox;
+use wcf\util\StringUtil;
 
 /**
  * Delivers the given email to the given mailbox.
@@ -86,6 +87,7 @@ class EmailDeliveryBackgroundJob extends AbstractBackgroundJob
             'data' => [
                 'time' => \TIME_NOW,
                 'messageID' => $this->email->getMessageID(),
+                'subject' => StringUtil::truncate($this->email->getSubject(), 30),
                 'recipient' => $this->envelopeTo->getAddress(),
                 'recipientID' => ($this->envelopeTo instanceof UserMailbox) ? $this->envelopeTo->getUser()->userID : null,
                 'status' => EmailLogEntry::STATUS_NEW,
index 6d3fb2a99bf234f6f08ec099a5460b0a0520b0b7..0cf67a0e0cf0a969143b83cb5a322e89af71d341 100644 (file)
                <item name="wcf.acp.email.smtp.test.error.notTlsSupport"><![CDATA[Der Server unterstützt keine Verschlüsselung.]]></item>
                <item name="wcf.acp.email.smtp.test.error.tlsFailed"><![CDATA[Der Aufbau einer verschlüsselten Verbindung war nicht möglich.]]></item>
                <item name="wcf.acp.email.log"><![CDATA[Versendete E-Mails]]></item>
-               <item name="wcf.acp.email.log.messageID"><![CDATA[Message-ID]]></item>
+               <item name="wcf.acp.email.log.subject"><![CDATA[Betreff]]></item>
                <item name="wcf.acp.email.log.time"><![CDATA[Erzeugt]]></item>
                <item name="wcf.acp.email.log.status"><![CDATA[Status]]></item>
                <item name="wcf.acp.email.log.status.success"><![CDATA[Erfolgreich versendet]]></item>
index ae9b8b19beef15f4526e0ea439fcc909457eb10a..71146eb68c4bbe2cebab51a5b83f90f84aad10de 100644 (file)
                <item name="wcf.acp.email.smtp.test.error.notTlsSupport"><![CDATA[The server does not support encryption.]]></item>
                <item name="wcf.acp.email.smtp.test.error.tlsFailed"><![CDATA[Unable to establish a secure connection.]]></item>
                <item name="wcf.acp.email.log"><![CDATA[Emails Sent]]></item>
-               <item name="wcf.acp.email.log.messageID"><![CDATA[Message-ID]]></item>
+               <item name="wcf.acp.email.log.subject"><![CDATA[Subject]]></item>
                <item name="wcf.acp.email.log.time"><![CDATA[Created]]></item>
                <item name="wcf.acp.email.log.status"><![CDATA[Status]]></item>
                <item name="wcf.acp.email.log.status.success"><![CDATA[Successfully Sent]]></item>
index 9c4d5eae4fb76f78675b4f32cce33a4c5fdc04e2..5ae64deec4e2c2fa89c2bb0daa4b379f10ebb1f4 100644 (file)
@@ -556,6 +556,7 @@ CREATE TABLE wcf1_email_log_entry (
        entryID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
        time INT(10) NOT NULL,
        messageID VARCHAR(255) NOT NULL,
+       subject VARCHAR(255) NOT NULL,
        recipient VARCHAR(255) NOT NULL,
        recipientID INT(10) DEFAULT NULL,
        status VARCHAR(255) NOT NULL,