From: Tim Düsterhus Date: Mon, 6 Jun 2016 22:11:51 +0000 (+0200) Subject: Use new email API for activation notifications X-Git-Tag: 3.0.0_Beta_1~916^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bde0e3dc235945bac5e062604c2a0417aac6811c;p=GitHub%2FWoltLab%2FWCF.git Use new email API for activation notifications --- diff --git a/com.woltlab.wcf/templates/email_adminActivation.tpl b/com.woltlab.wcf/templates/email_adminActivation.tpl new file mode 100644 index 0000000000..0c649ac7c8 --- /dev/null +++ b/com.woltlab.wcf/templates/email_adminActivation.tpl @@ -0,0 +1,11 @@ +{if $mimeType === 'text/plain'} +{capture assign='content'}{lang}wcf.acp.user.activation.mail.plaintext{/lang}{/capture} +{include file='email_plaintext'} +{else} + {capture assign='content'} +

{lang}wcf.acp.user.activation.mail.html.headline{/lang}

+ {lang}wcf.acp.user.activation.mail.html.text{/lang} + {/capture} + + {include file='email_html'} +{/if} diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index c5b296ca3d..f700923578 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -11,7 +11,10 @@ use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\event\EventHandler; use wcf\system\exception\PermissionDeniedException; use wcf\system\exception\UserInputException; -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\RequestHandler; use wcf\system\WCF; use wcf\util\UserRegistrationUtil; @@ -585,10 +588,14 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio // send e-mail notification if (empty($this->parameters['skipNotification'])) { foreach ($this->getObjects() as $user) { - $mail = new Mail([$user->username => $user->email], $user->getLanguage()->getDynamicVariable('wcf.acp.user.activation.mail.subject'), $user->getLanguage()->getDynamicVariable('wcf.acp.user.activation.mail', [ - 'username' => $user->username + $email = new Email(); + $email->addRecipient(new UserMailbox($user->getDecoratedObject())); + $email->setSubject($user->getLanguage()->getDynamicVariable('wcf.acp.user.activation.mail.subject')); + $email->setBody(new MimePartFacade([ + new RecipientAwareTextMimePart('text/html', 'email_adminActivation'), + new RecipientAwareTextMimePart('text/plain', 'email_adminActivation') ])); - $mail->send(); + $email->send(); } } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index efe27d3828..e7d0ccea51 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1799,11 +1799,18 @@ Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} unter System -> O - + getUser()->username},]]> + {if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Benutzerkonto auf der Website: {PAGE_TITLE|language} wurde von einem Administrator +freigeschaltet. {if LANGUAGE_USE_INFORMAL_VARIANT}Du kannst{else}Sie können{/if} die Funktionen {if LANGUAGE_USE_INFORMAL_VARIANT}deines{else}Ihres{/if} Benutzerkontos nun in vollem Umfang nutzen.

]]>
+ getUser()->username}, + +{if LANGUAGE_USE_INFORMAL_VARIANT}Ihr{else}Dein{/if} Benutzerkonto auf der Website: {@PAGE_TITLE|language} [1] wurde von +einem Administrator freigeschaltet. {if LANGUAGE_USE_INFORMAL_VARIANT}Du kannst{else}Sie können{/if} die Funktionen {if LANGUAGE_USE_INFORMAL_VARIANT}deines{else}Ihres{/if} +Benutzerkontos nun in vollem Umfang nutzen. + +[1] {link}{/link}]]> @@ -3031,13 +3038,13 @@ Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}achte{else}achten Sie{/if} darauf, dass getUser()->username},]]> vielen Dank für {if LANGUAGE_USE_INFORMAL_VARIANT}deine{else}Ihre{/if} Registrierung auf der Website: {@PAGE_TITLE|language}. 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}:

]]>
+

vielen Dank für {if LANGUAGE_USE_INFORMAL_VARIANT}deine{else}Ihre{/if} Registrierung auf der Website: {PAGE_TITLE|language}. Bevor {if LANGUAGE_USE_INFORMAL_VARIANT}du dein{else}Sie Ihr{/if} +Benutzerkonto vollständig verwenden können ist es notwendig, dass {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} einmalig 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}:

]]> {if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Aktivierungscode lautet: {@$mailbox->getUser()->activationCode}.

-

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 {if LANGUAGE_USE_INFORMAL_VARIANT}hast{else}haben{/if}, +

{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Aktivierungscode lautet: {$mailbox->getUser()->activationCode}.

+

Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} Probleme mit der Aktivierung {if LANGUAGE_USE_INFORMAL_VARIANT}deines{else}Ihres{/if} 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 {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.

]]>
getUser()->username}, @@ -3054,7 +3061,7 @@ Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} Probleme mit der Aktivie 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. +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. [1] {link}{/link}]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index bbe194aea3..dbbd6aa3e0 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1772,11 +1772,18 @@ Login with your new password: {link controller='Login' isEmail=true}{/link}]]> - + getUser()->username},]]> + your account on the website: {PAGE_TITLE|language} has been approved +by an administrator. You are now able to use your user account to it’s full extend.

]]>
+ getUser()->username}, + +your account on the website: {@PAGE_TITLE|language} [1] has been approved +by an administrator. You are now able to use your user account to it’s +full extend. + +[1] {link}{/link}]]> @@ -3069,13 +3076,13 @@ If you cannot activate your email address or have any troubles following the ins getUser()->username},]]> thank you for registering at: {@PAGE_TITLE|language}. Before you are able to use your +

thank you for registering at: {PAGE_TITLE|language}. 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:

]]>
Your activation code is: {@$mailbox->getUser()->activationCode}.

+

Your activation code is: {$mailbox->getUser()->activationCode}.

If you have troubles confirming your email address, please contact the administrator at: -{@MAIL_ADMIN_ADDRESS}. Please ignore this email if +{MAIL_ADMIN_ADDRESS}. Please ignore this email if you did not register an account with us.

]]>
getUser()->username},