<html>
+ <head>
+ <style type="text/css">
+ html {
+ padding: 0;
+ margin: 0;
+ font-family: {@$style->getVariable('wcfFontFamilyFallback', true)};
+ }
+ body {
+ padding: 0;
+ margin: 0;
+ background-color: {$style->getVariable('wcfContentBackground', true)};
+ }
+ .content {
+ padding: 0 20px;
+ }
+ .footer {
+ background-color: {$style->getVariable('wcfFooterBackground', true)};
+ color: {$style->getVariable('wcfFooterText', true)};
+ padding: 20px 10px;
+ }
+ h1 {
+ font-weight: 300;
+ line-height: 1.05;
+ font-size: {$style->getVariable('wcfFontSizeTitle')};
+ color: {$style->getVariable('wcfContentHeadlineText')};
+ }
+ a {
+ color: {$style->getVariable('wcfContentLink', true)};
+ text-decoration: none;
+ }
+ a.button {
+ background-color: {$style->getVariable('wcfButtonPrimaryBackground', true)};
+ color: {$style->getVariable('wcfButtonPrimaryText', true)};
+ border-radius: 2px;
+ padding: 6px 12px;
+ }
+ </style>
+ </head>
<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 class="content">
+ {@$content}
</div>
- <div class="content">{@$content}</div>
{hascontent}
- <div class="signature" style="color: grey; font-size: 10px;">
+ <div class="footer">
-- <br>
{content}
- {@MAIL_SIGNATURE|language}
+ {@MAIL_SIGNATURE|language|nl2br}
{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}
-{hascontent}
+{hascontent} {* this line ends with a space *}
--- {* The Space is important, do not remove *}
+-- {* this line ends with a space *}
{content}
{@MAIL_SIGNATURE|language}
{if $mailbox|is_a:'wcf\system\email\UserMailbox'}{if MAIL_SIGNATURE|language}{* add newlines *}
--- /dev/null
+{if $mimeType === 'text/plain'}
+{capture assign='content'}{lang}wcf.user.register.needActivation.mail.plaintext{/lang}{/capture}
+{include file='email_plaintext'}
+{else}
+ {capture assign='content'}
+ <h1>{lang}wcf.user.register.needActivation.mail.html.headline{/lang}</h1>
+ {lang}wcf.user.register.needActivation.mail.html.intro{/lang}
+ <a href="{link controller='RegisterActivation' isEmail=true}u={@$mailbox->getUser()->userID}&a={@$mailbox->getUser()->activationCode}{/link}" class="button">
+ {lang}wcf.user.register.needActivation.mail.html.activate{/lang}
+ </a>
+ {lang}wcf.user.register.needActivation.mail.html.outro{/lang}
+ {/capture}
+ {include file='email_html'}
+{/if}
/**
* Returns a specific style variable or null if not found.
+ * If $toHex is set to true the color defined by the variable
+ * will be converted to the hexadecimal notation (e.g. for use
+ * in emails)
*
* @param string $variableName
+ * @param boolean $toHex
* @return string
*/
- public function getVariable($variableName) {
+ public function getVariable($variableName, $toHex = false) {
if (isset($this->variables[$variableName])) {
// check if variable is empty
if ($this->variables[$variableName] == '~""') {
return '';
}
+ if ($toHex && preg_match('/^rgba\((\d+), (\d+), (\d+), 1\)$/', $this->variables[$variableName], $matches)) {
+ return sprintf('#%02x%02x%02x', $matches[1], $matches[2], $matches[3]);
+ }
+
return $this->variables[$variableName];
}
use wcf\system\exception\SystemException;
use wcf\system\exception\UserInputException;
use wcf\system\language\LanguageFactory;
-use wcf\system\mail\Mail;
+use wcf\system\email\mime\MimePartFacade;
+use wcf\system\email\mime\RecipientAwareTextMimePart;
+use wcf\system\email\Email;
+use wcf\system\email\UserMailbox;
use wcf\system\request\LinkHandler;
use wcf\system\user\authentication\UserAuthenticationFactory;
use wcf\system\Regex;
$this->message = 'wcf.user.register.success';
}
else {
- $mail = new Mail([$this->username => $this->email],
- WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail.subject'),
- WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail', ['user' => $user])
- );
- $mail->send();
- $this->message = 'wcf.user.register.needActivation';
+ $email = new Email();
+ $email->addRecipient(new UserMailbox(WCF::getUser()));
+ $email->setSubject(WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail.subject'));
+ $email->setBody(new MimePartFacade([
+ new RecipientAwareTextMimePart('text/html', 'email_registerNeedActivation'),
+ new RecipientAwareTextMimePart('text/plain', 'email_registerNeedActivation')
+ ]));
+ $email->send();
+ $this->message = 'wcf.user.register.success.needActivation';
}
}
else if (REGISTER_ACTIVATION_METHOD == 2) {
- $this->message = 'wcf.user.register.awaitActivation';
+ $this->message = 'wcf.user.register.success.awaitActivation';
}
// notify admin
try {
if ($this->mailbox) WCF::setLanguage($this->mailbox->getLanguage()->languageID);
- return EmailTemplateEngine::getInstance()->fetch($this->template, $this->application, $this->getTemplateVariables(), true);
+ $result = EmailTemplateEngine::getInstance()->fetch($this->template, $this->application, $this->getTemplateVariables(), true);
+
+ if ($this->mimeType === 'text/html') {
+ $emogrifier = new \Pelago\Emogrifier();
+ $emogrifier->disableInvisibleNodeRemoval();
+
+ $emogrifier->setHtml($result);
+
+ $result = $emogrifier->emogrify();
+ }
+
+ return $result;
}
finally {
WCF::setLanguage($language->languageID);
<category name="wcf.user.register">
<item name="wcf.user.register"><![CDATA[Registrierung]]></item>
+
+ <!-- Need Activation -->
+ <item name="wcf.user.register.needActivation"><![CDATA[Ihr Benutzerkonto ist noch nicht aktiviert. Sie müssen den <a href="{link controller='RegisterActivation'}{/link}">Aktivierungsvorgang abschließen</a>, um den vollen Funktionsumfang dieser Seite nutzen zu können.]]></item>
<item name="wcf.user.register.needActivation.mail.subject"><![CDATA[Aktivierung der Registrierung auf der Website: {@PAGE_TITLE|language}]]></item>
- <item name="wcf.user.register.needActivation"><![CDATA[Vielen Dank für die Registrierung, {$user->username}.<br>
+ <item name="wcf.user.register.needActivation.mail.html.headline"><![CDATA[Hallo {$mailbox->getUser()->username},]]></item>
+ <item name="wcf.user.register.needActivation.mail.html.intro"><![CDATA[
+<p>vielen Dank für {if LANGUAGE_USE_INFORMAL_VARIANT}deine{else}Ihre{/if} Registrierung auf der Website: <a href="{link}{/link}">{@PAGE_TITLE|language}</a>. Bevor {if LANGUAGE_USE_INFORMAL_VARIANT}du dein{else}Sie Ihr{/if}
+Benutzerkonto vollständig verwenden {if LANGUAGE_USE_INFORMAL_VARIANT}kannst{else}können{/if} ist es notwendig, dass {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} einmalig die Gültigkeit Ihrer E-Mail-Adresse {if LANGUAGE_USE_INFORMAL_VARIANT}bestätigst{else}bestätigen{/if}:</p>]]></item>
+ <item name="wcf.user.register.needActivation.mail.html.activate"><![CDATA[Benutzerkonto aktivieren!]]></item>
+ <item name="wcf.user.register.needActivation.mail.html.outro"><![CDATA[
+<p>{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Aktivierungscode lautet: <code>{@$mailbox->getUser()->activationCode}</code>.</p>
+<p>Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} Probleme mit der Aktivierung Ihres Benutzerkontos {if LANGUAGE_USE_INFORMAL_VARIANT}hast{else}haben{/if}, dann {if LANGUAGE_USE_INFORMAL_VARIANT}wende dich{else}wenden Sie sich{/if} bitte an den Administrator
+unter: <a href="mailto:{@MAIL_ADMIN_ADDRESS}">{@MAIL_ADMIN_ADDRESS}</a>. Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du dich{else}Sie sich{/if} nicht bei uns registriert {if LANGUAGE_USE_INFORMAL_VARIANT}hast{else}haben{/if},
+dann {if LANGUAGE_USE_INFORMAL_VARIANT}kannst du{else}können Sie{/if} diese E-Mail ignorieren.</p>]]></item>
+ <item name="wcf.user.register.needActivation.mail.plaintext"><![CDATA[Hallo {$mailbox->getUser()->username},
+
+vielen Dank für {if LANGUAGE_USE_INFORMAL_VARIANT}deine{else}Ihre{/if} Registrierung auf der Website: {@PAGE_TITLE|language} [1].
+Bevor {if LANGUAGE_USE_INFORMAL_VARIANT}du dein{else}Sie Ihr{/if} Benutzerkonto vollständig verwenden {if LANGUAGE_USE_INFORMAL_VARIANT}kannst{else}können{/if} ist es notwendig,
+dass Sie einmalig durch Klicken des Folgenden Links die Gültigkeit {if LANGUAGE_USE_INFORMAL_VARIANT}deiner{else}Ihrer{/if}
+E-Mail-Adresse {if LANGUAGE_USE_INFORMAL_VARIANT}bestätigst{else}bestätigen{/if}:
+
+ {link controller='RegisterActivation' isEmail=true}u={@$mailbox->getUser()->userID}&a={@$mailbox->getUser()->activationCode}{/link} {* this line ends with a space *}
+
+{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Aktivierungscode lautet: {@$mailbox->getUser()->activationCode} {* this line ends with a space *}
+
+Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} Probleme mit der Aktivierung Ihres Benutzerkontos {if LANGUAGE_USE_INFORMAL_VARIANT}hast{else}haben{/if}, dann {if LANGUAGE_USE_INFORMAL_VARIANT}wende
+dich{else}wenden
+Sie sich{/if} bitte an den Administrator unter: {@MAIL_ADMIN_ADDRESS}. Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du
+dich{else}Sie
+sich{/if} nicht bei uns registriert haben, dann {if LANGUAGE_USE_INFORMAL_VARIANT}kannst du{else}können Sie{/if} diese E-Mail ignorieren.
+
+[1] {link}{/link}]]></item>
+
+ <!-- Success Messages -->
+ <item name="wcf.user.register.success"><![CDATA[Vielen Dank für die Registrierung, {$user->username}. Ihre Registrierung ist hiermit vollständig abgeschlossen.]]></item>
+ <item name="wcf.user.register.success.needActivation"><![CDATA[Vielen Dank für die Registrierung, {$user->username}.<br>
Wir haben {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} eine E-Mail an {$user->email} geschickt. Die E-Mail enthält einen Link, den {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} einmalig aufrufen {if LANGUAGE_USE_INFORMAL_VARIANT}musst{else}müssen{/if}, um die Gültigkeit {if LANGUAGE_USE_INFORMAL_VARIANT}deiner{else}Ihrer{/if} E-Mail-Adresse zu bestätigen und damit {if LANGUAGE_USE_INFORMAL_VARIANT}deine{else}Ihre{/if} Registrierung abzuschließen.]]></item>
- <item name="wcf.user.register.awaitActivation"><![CDATA[Vielen Dank für die Registrierung, {$user->username}. {if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} Benutzerdaten werden in Kürze von einem Administrator geprüft.<br>
+ <item name="wcf.user.register.success.awaitActivation"><![CDATA[Vielen Dank für die Registrierung, {$user->username}. {if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} Benutzerdaten werden in Kürze von einem Administrator geprüft.<br>
Sobald {if LANGUAGE_USE_INFORMAL_VARIANT}dein{else}Ihr{/if} Benutzerkonto freigeschaltet ist, {if LANGUAGE_USE_INFORMAL_VARIANT}wirst du{else}werden Sie{/if} per E-Mail darüber in Kenntnis gesetzt.]]></item>
+
+ <!-- Error Messages -->
+ <item name="wcf.user.register.error.disabled"><![CDATA[Die Registrierung ist momentan deaktiviert.]]></item>
+
+ <!-- Administrator Notification -->
<item name="wcf.user.register.notification.mail"><![CDATA[Hallo Administrator,
auf der Website {@PAGE_TITLE|language} erfolgte eine neue Benutzeranmeldung durch: {@$user->username}
{if LANGUAGE_USE_INFORMAL_VARIANT}Du erreichst{else}Sie erreichen{/if} das Benutzerprofil des neuen Benutzers, indem {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} folgenden Link {if LANGUAGE_USE_INFORMAL_VARIANT}aufrufst{else}aufrufen{/if}:
{link controller='User' object=$user isEmail=true}{/link} ]]></item>
<item name="wcf.user.register.notification.mail.subject"><![CDATA[Neue Benutzeranmeldung auf der Website: {@PAGE_TITLE|language}]]></item>
- <item name="wcf.user.register.error.disabled"><![CDATA[Die Registrierung ist momentan deaktiviert.]]></item>
- <item name="wcf.user.register.success"><![CDATA[Vielen Dank für die Registrierung, {$user->username}. {if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} Registrierung ist hiermit vollständig abgeschlossen.]]></item>
- <item name="wcf.user.register.needActivation.mail"><![CDATA[Hallo {@$user->username},
-
-vielen Dank für {if LANGUAGE_USE_INFORMAL_VARIANT}deine{else}Ihre{/if} Registrierung auf der Website: {@PAGE_TITLE|language}.
-Bevor wir {if LANGUAGE_USE_INFORMAL_VARIANT}deine{else}Ihre{/if} Registrierung aktivieren können, {if LANGUAGE_USE_INFORMAL_VARIANT}musst du{else}müssen Sie{/if} einmalig die Gültigkeit {if LANGUAGE_USE_INFORMAL_VARIANT}deiner{else}Ihrer{/if} E-Mail-Adresse bestätigen.
-
-Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}bestätige{else}bestätigen Sie{/if} die Gültigkeit {if LANGUAGE_USE_INFORMAL_VARIANT}deiner{else}Ihrer{/if} E-Mail-Adresse, indem {if LANGUAGE_USE_INFORMAL_VARIANT}du folgenden Link aufrufst{else}Sie folgenden Link aufrufen{/if}:
-{link controller='RegisterActivation' isEmail=true}u={@$user->userID}&a={@$user->activationCode}{/link}
-
-**** Funktioniert der Link oben nicht? ****
-Wenn der Link nicht funktioniert, {if LANGUAGE_USE_INFORMAL_VARIANT}solltest du{else}sollten Sie{/if} folgende Adresse in {if LANGUAGE_USE_INFORMAL_VARIANT}deinem{else}Ihrem{/if} Browser aufrufen:
-{link controller='RegisterActivation' isEmail=true}{/link}
-
-Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}achte{else}achten Sie{/if} darauf, dass keine Leerzeichen in der Adresse sind.
-Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du den Link aufgerufen hast, musst du auf der erscheinenden Seite deinen{else}Sie den Link aufgerufen haben, müssen Sie auf der erscheinenden Seite Ihren{/if} Benutzernamen sowie den Aktivierungscode eingeben.
-
-{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Benutzername lautet: {@$user->username}
-{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Aktivierungscode lautet: {@$user->activationCode}
-
-Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du Probleme mit der Aktivierung haben solltest, wende dich{else}Sie Probleme mit der Aktivierung haben, wenden Sie sich{/if} bitte an den Administrator: {@MAIL_ADMIN_ADDRESS}
-
-{if LANGUAGE_USE_INFORMAL_VARIANT}Solltest du dich nicht auf der Website: {@PAGE_TITLE|language} angemeldet haben, kannst du diese E-Mail ignorieren{else}Sollten Sie sich nicht auf der Website: {@PAGE_TITLE|language} angemeldet haben, können Sie diese E-Mail ignorieren{/if}. ]]></item>
- <item name="wcf.user.register.needActivation"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Benutzerkonto ist noch nicht aktiviert. {if LANGUAGE_USE_INFORMAL_VARIANT}du musst{else}Sie müssen{/if} den <a href="{link controller='RegisterActivation'}{/link}">Aktivierungsvorgang abschließen</a>, um den vollen Funktionsumfang dieser Seite nutzen zu können.]]></item>
+
+ <!-- Disclaimer -->
<item name="wcf.user.register.disclaimer.accept"><![CDATA[Akzeptieren]]></item>
<item name="wcf.user.register.disclaimer.decline"><![CDATA[Ablehnen]]></item>
<item name="wcf.user.register.disclaimer.text"><![CDATA[<h2>Haftungsbeschränkung für eigene Inhalte</h2>
<category name="wcf.user.register">
<item name="wcf.user.register"><![CDATA[Registration]]></item>
+
+ <!-- Need Activation -->
+ <item name="wcf.user.register.needActivation"><![CDATA[Your user account is not activated yet. You must complete the <a href="{link controller='RegisterActivation'}{/link}">activation process</a> first.]]></item>
<item name="wcf.user.register.needActivation.mail.subject"><![CDATA[Activate Your Registration for Website: {@PAGE_TITLE|language}]]></item>
- <item name="wcf.user.register.needActivation"><![CDATA[Thank you for registering, {$user->username}.<br>
+ <item name="wcf.user.register.needActivation.mail.html.headline"><![CDATA[Dear {$mailbox->getUser()->username},]]></item>
+ <item name="wcf.user.register.needActivation.mail.html.intro"><![CDATA[
+<p>thank you for registering at: <a href="{link}{/link}">{@PAGE_TITLE|language}</a>. Before you are able to use your
+user account to it’s full extent it is required that you confirm validity of your email address once:</p>]]></item>
+ <item name="wcf.user.register.needActivation.mail.html.activate"><![CDATA[Confirm my email address!]]></item>
+ <item name="wcf.user.register.needActivation.mail.html.outro"><![CDATA[
+<p>Your activation code is: <code>{@$mailbox->getUser()->activationCode}</code>.</p>
+<p>If you have troubles confirming your email address, please contact the administrator at:
+<a href="mailto:{@MAIL_ADMIN_ADDRESS}">{@MAIL_ADMIN_ADDRESS}</a>. Please ignore this email if
+you did not register an account with us.</p>]]></item>
+ <item name="wcf.user.register.needActivation.mail.plaintext"><![CDATA[Dear {$mailbox->getUser()->username},
+
+thank your for registering at: {@PAGE_TITLE|language} [1]. Before you are
+able to user your user account to it's full extent it is required that you
+confirm the validity of your email address once:
+
+ {link controller='RegisterActivation' isEmail=true}u={@$mailbox->getUser()->userID}&a={@$mailbox->getUser()->activationCode}{/link} {* this line ends with a space *}
+
+Your activation code is: {@$mailbox->getUser()->activationCode} {* this line ends with a space *}
+
+If you have troubles confirming your email address, please contect the
+administrator at: {@MAIL_ADMIN_ADDRESS}. Please ignore this email if you did
+not register with us.
+
+[1] {link}{/link}]]></item>
+
+ <!-- Success Messages -->
+ <item name="wcf.user.register.success"><![CDATA[Thank you for registering, {$user->username}.<br>
+Your registration is now completed.]]></item>
+ <item name="wcf.user.register.success.needActivation"><![CDATA[Thank you for registering, {$user->username}.<br>
An email was sent to “{$user->email}” containing a one-time link to verify your account and ultimately completing your registration.]]></item>
- <item name="wcf.user.register.awaitActivation"><![CDATA[Thank you for registering, {$user->username}.<br>
+ <item name="wcf.user.register.success.awaitActivation"><![CDATA[Thank you for registering, {$user->username}.<br>
Your account is awaiting approval from an administrator.<br>
A notification will be sent once your account has been approved.]]></item>
+
+ <!-- Error Messages -->
+ <item name="wcf.user.register.error.disabled"><![CDATA[Registration is currently disabled.]]></item>
+
+ <!-- Administrator Notification -->
<item name="wcf.user.register.notification.mail"><![CDATA[Dear Administrator,
someone registered with your website {@PAGE_TITLE|language}: {@$user->username}
Open the link below to access the user profile:
{link controller='User' object=$user isEmail=true}{/link} ]]></item>
<item name="wcf.user.register.notification.mail.subject"><![CDATA[New Registration with Your Website: {@PAGE_TITLE|language}]]></item>
- <item name="wcf.user.register.error.disabled"><![CDATA[Registration is currently disabled.]]></item>
- <item name="wcf.user.register.success"><![CDATA[Thank you for registering, {$user->username}.<br>
-Your registration is now completed.]]></item>
- <item name="wcf.user.register.needActivation.mail"><![CDATA[Dear {@$user->username},
-
-thank you for registering on our website: {@PAGE_TITLE|language}. It is required to open the link below in order to verify your email address.
-
-{link controller='RegisterActivation' isEmail=true}u={@$user->userID}&a={@$user->activationCode}{/link}
-
-**** Unable to click or open the link above? ****
-Please open the link below in your browser:
-{link controller='RegisterActivation' isEmail=true}{/link}
-
-Once prompted provide the details as shown below:
-
-Your username: {@$user->username}
-Activation Code: {@$user->activationCode}
-
-If you cannot open the link or have troubles following the instructions, please contact the administrator: {@MAIL_ADMIN_ADDRESS}
-
-You can safely ignore this email if you did not register with the website: {@PAGE_TITLE|language}.]]></item>
- <item name="wcf.user.register.needActivation"><![CDATA[Your user account is not activated yet. You must complete the <a href="{link controller='RegisterActivation'}{/link}">activation process</a> first.]]></item>
- <item name="wcf.user.register.disclaimer.accept"><![CDATA[Accept]]></item>
+
+ <!-- Disclaimer -->
+ <item name="wcf.user.register.disclaimer.accept"><![CDATA[Accept]]></item>
<item name="wcf.user.register.disclaimer.decline"><![CDATA[Decline]]></item>
<item name="wcf.user.register.disclaimer.text"><![CDATA[<h2>Limitation of liability for internal content</h2>
<p>The content of our website has been compiled with meticulous care and to the best of our knowledge. However, we cannot assume any liability for the up-to-dateness, completeness or accuracy of any of the pages.</p>