Add emailTextHtml.tpl
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 10 Jul 2015 14:05:37 +0000 (16:05 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 14 Jul 2015 18:58:29 +0000 (20:58 +0200)
com.woltlab.wcf/templates/emailTextHtml.tpl [new file with mode: 0644]
wcfsetup/install/files/lib/system/email/mime/HtmlTextMimePart.class.php [new file with mode: 0644]

diff --git a/com.woltlab.wcf/templates/emailTextHtml.tpl b/com.woltlab.wcf/templates/emailTextHtml.tpl
new file mode 100644 (file)
index 0000000..4cec0b4
--- /dev/null
@@ -0,0 +1,22 @@
+<html>
+<body>
+<div style="text-align: center;">
+<a href="{link}{/link}">
+{if $__wcf->getStyleHandler()->getStyle()->getPageLogo()}<img src="{$__wcf->getStyleHandler()->getStyle()->getPageLogo()}" alt="">{/if}
+{event name='headerLogo'}
+</a>
+</div>
+<div class="content">{$content}</div>
+{hascontent}
+<div class="signature" style="color: grey; font-size: 10px;">
+-- <br>
+{content}
+{@MAIL_SIGNATURE|language}
+{if $mailbox|is_a:'wcf\system\email\UserMailbox'}
+{if MAIL_SIGNATURE|language}<br><br>{/if}
+This email was sent to you, because you registered on the {$mailbox->getUser()->registrationDate|plainTime} at {@PAGE_TITLE|language}.{/if} {* TODO: language item *}
+{/content}
+</div>
+{/hascontent}
+</body>
+</html>
diff --git a/wcfsetup/install/files/lib/system/email/mime/HtmlTextMimePart.class.php b/wcfsetup/install/files/lib/system/email/mime/HtmlTextMimePart.class.php
new file mode 100644 (file)
index 0000000..6b22c03
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+namespace wcf\system\email\mime;
+use wcf\system\email\UserMailbox;
+use wcf\system\WCF;
+
+/**
+ * HtmlTextMimePart is a text/html implementation of an
+ * AbstractRecipientAwareTextMimePart.
+ * 
+ * @author     Tim Duesterhus
+ * @copyright  2001-2015 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.email.mime
+ * @category   Community Framework
+ */
+class HtmlTextMimePart extends AbstractRecipientAwareTextMimePart {
+       /**
+        * template to use for this email
+        * @var string
+        */
+       protected $template = 'emailTextHtml';
+       
+       /**
+        * Creates a new HtmlTextMimePart.
+        * 
+        * @param       string  $content        Content of this text part.
+        */
+       public function __construct($content) {
+               parent::__construct($content, 'text/html');
+       }
+}