+++ /dev/null
-{if $mimeType === 'text/plain'}
-{@$content}
-{hascontent}
-
--- {* The Space is important, do not remove *}
-{content}
-{@MAIL_SIGNATURE|language}
-{if $mailbox|is_a:'wcf\system\email\UserMailbox'}{if MAIL_SIGNATURE|language}{* add newlines *}
-
-
-{/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}
-{/hascontent}
-
-{elseif $mimeType === 'text/html'}
-<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>
-{/if}
--- /dev/null
+<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}
+
+ <table>{* Do not remove: This table is needed by certain less able email clients to properly support background colors. Don't ask. *}</table>
+ </body>
+</html>
--- /dev/null
+{@$content}
+{hascontent}
+
+-- {* The Space is important, do not remove *}
+{content}
+{@MAIL_SIGNATURE|language}
+{if $mailbox|is_a:'wcf\system\email\UserMailbox'}{if MAIL_SIGNATURE|language}{* add newlines *}
+
+
+{/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}
+{/hascontent}
* @param string $content Content of this text part.
*/
public function __construct($content) {
- parent::__construct($content, 'text/html', 'email');
+ parent::__construct($content, 'text/html', 'email_html');
}
}
* @param string $content Content of this text part.
*/
public function __construct($content) {
- parent::__construct($content, 'text/plain', 'email');
+ parent::__construct($content, 'text/plain', 'email_plaintext');
}
}
try {
if ($this->mailbox) WCF::setLanguage($this->mailbox->getLanguage()->languageID);
- return EmailTemplateEngine::getInstance()->fetch($this->template, $this->application, [
- 'content' => $this->content,
- 'mimeType' => $this->mimeType,
- 'mailbox' => $this->mailbox
- ], true);
+ return EmailTemplateEngine::getInstance()->fetch($this->template, $this->application, $this->getTemplateVariables(), true);
}
finally {
WCF::setLanguage($language->languageID);
}
}
+
+ /**
+ * Returns the templates variables to be passed to the EmailTemplateEngine.
+ *
+ * @return mixed[]
+ */
+ protected function getTemplateVariables() {
+ return [
+ 'content' => $this->content,
+ 'mimeType' => $this->mimeType,
+ 'mailbox' => $this->mailbox
+ ];
+ }
}