Added frontend contact form
authorAlexander Ebert <ebert@woltlab.com>
Wed, 21 Jun 2017 09:52:19 +0000 (11:52 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 21 Jun 2017 09:52:26 +0000 (11:52 +0200)
See #2308

16 files changed:
com.woltlab.wcf/menuItem.xml
com.woltlab.wcf/page.xml
com.woltlab.wcf/templates/contact.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/customOptionFieldList.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/email_contact.tpl [new file with mode: 0644]
wcfsetup/install/files/lib/data/contact/option/ContactOptionAction.class.php
wcfsetup/install/files/lib/data/contact/option/ContactOptionEditor.class.php
wcfsetup/install/files/lib/data/contact/recipient/ContactRecipient.class.php
wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php
wcfsetup/install/files/lib/form/ContactForm.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/cache/builder/ContactOptionCacheBuilder.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/ContactOptionHandler.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/CustomOptionHandler.class.php [new file with mode: 0644]
wcfsetup/install/files/style/layout/form.scss
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index a78e55a2726e7d7a84084bc7fead0f8fc3e03eb8..7944df241ca69df283515f22501318e94a0bc330 100644 (file)
                        <title language="en">Privacy Policy</title>
                        <page>com.woltlab.wcf.PrivacyPolicy</page>
                </item>
+               <item identifier="com.woltlab.wcf.Contact">
+                       <menu>com.woltlab.wcf.FooterMenu</menu>
+                       <title language="de">Kontakt</title>
+                       <title language="en">Contact</title>
+                       <page>com.woltlab.wcf.Contact</page>
+               </item>
        </import>
 </data>
index 02442110507cff3437d565b21d89b5b47a44c9c5..a9c03d5d633fe375b4647ad49db3c0a46642fb8b 100644 (file)
                        <requireObjectID>1</requireObjectID>
                        <allowSpidersToIndex>1</allowSpidersToIndex>
                </page>
+               <page identifier="com.woltlab.wcf.Contact">
+                       <pageType>system</pageType>
+                       <controller>wcf\form\ContactForm</controller>
+                       <name language="de">Kontakt-Formular</name>
+                       <name language="en">Contact Form</name>
+                       <options>module_contact_form</options>
+                       <allowSpidersToIndex>0</allowSpidersToIndex>
+                       
+                       <content language="en">
+                               <title>Contact</title>
+                       </content>
+                       <content language="de">
+                               <title>Kontakt</title>
+                       </content>
+               </page>
                
                <!-- static -->
                <page identifier="com.woltlab.wcf.Dashboard">
diff --git a/com.woltlab.wcf/templates/contact.tpl b/com.woltlab.wcf/templates/contact.tpl
new file mode 100644 (file)
index 0000000..b29fbea
--- /dev/null
@@ -0,0 +1,89 @@
+{include file='header'}
+
+{include file='formError'}
+
+<form method="post" action="{link controller='Contact'}{/link}">
+       <section class="section">
+               <h2 class="sectionTitle">{lang}wcf.contact.sender.information{/lang}</h2>
+               
+               <dl{if $errorField == 'name'} class="formError"{/if}>
+                       <dt><label for="name">{lang}wcf.contact.sender{/lang}</label></dt>
+                       <dd>
+                               <input type="text" id="name" name="name" value="{$name}" required class="long">
+                               {if $errorField == 'name'}
+                                       <small class="innerError">
+                                               {if $errorType == 'empty'}
+                                                       {lang}wcf.global.form.error.empty{/lang}
+                                               {else}
+                                                       {lang}wcf.contact.sender.error.{@$errorType}{/lang}
+                                               {/if}
+                                       </small>
+                               {/if}
+                       </dd>
+               </dl>
+               
+               <dl{if $errorField == 'email'} class="formError"{/if}>
+                       <dt><label for="email">{lang}wcf.user.email{/lang}</label></dt>
+                       <dd>
+                               <input type="email" id="email" name="email" value="{$email}" required class="medium">
+                               {if $errorField == 'email'}
+                                       <small class="innerError">
+                                               {if $errorType == 'empty'}
+                                                       {lang}wcf.global.form.error.empty{/lang}
+                                               {else}
+                                                       {lang}wcf.user.email.error.{@$errorType}{/lang}
+                                               {/if}
+                                       </small>
+                               {/if}
+                       </dd>
+               </dl>
+               
+               {event name='informationFields'}
+       </section>
+       
+       <section class="section">
+               <h2 class="sectionTitle">{lang}wcf.contact.data{/lang}</h2>
+               
+               {if $recipientList|count > 1}
+                       <dl{if $errorField == 'recipientID'} class="formError"{/if}>
+                               <dt><label for="recipientID">{lang}wcf.contact.recipientID{/lang}</label></dt>
+                               <dd>
+                                       <select name="recipientID" id="recipientID">
+                                               <option value="">{lang}wcf.global.noSelection{/lang}</option>
+                                               {foreach from=$recipientList item=recipient}
+                                                       <option value="{@$recipient->recipientID}">{$recipient}</option>
+                                               {/foreach}
+                                       </select>
+                                       {if $errorField == 'recipientID'}
+                                               <small class="innerError">
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {else}
+                                                               {lang}wcf.contact.recipientID.error.{@$errorType}{/lang}
+                                                       {/if}
+                                               </small>
+                                       {/if}
+                               </dd>
+                       </dl>
+               {/if}
+               
+               {include file='customOptionFieldList'}
+               
+               {event name='optionFields'}
+       </section>
+       
+       {event name='sections'}
+       
+       {include file='captcha' supportsAsyncCaptcha=true}
+       
+       <div class="formSubmit">
+               <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s">
+               {@SECURITY_TOKEN_INPUT_TAG}
+       </div>
+       
+       <div class="section">
+               <p><span class="customOptionRequired">*</span> {lang}wcf.contact.options.required{/lang}</p>
+       </div>
+</form>
+
+{include file='footer'}
diff --git a/com.woltlab.wcf/templates/customOptionFieldList.tpl b/com.woltlab.wcf/templates/customOptionFieldList.tpl
new file mode 100644 (file)
index 0000000..23fb04c
--- /dev/null
@@ -0,0 +1,19 @@
+{foreach from=$options item=optionData}
+       {assign var=option value=$optionData[object]}
+       <dl class="{if $errorType|is_array && $errorType[$option->optionName]|isset} formError{/if}">
+               <dt{if $optionData[cssClassName]} class="{$optionData[cssClassName]}"{/if}><label for="{$option->optionName}">{lang}{$option->optionTitle}{/lang}</label>{if $option->required} <span class="customOptionRequired">*</span>{/if}</dt>
+               <dd>{@$optionData[html]}
+                       <small>{lang __optional=true}{$option->optionDescription}{/lang}</small>
+                       
+                       {if $errorType|is_array && $errorType[$option->optionName]|isset}
+                               <small class="innerError">
+                                       {if $errorType[$option->optionName] == 'empty'}
+                                               {lang}wcf.global.form.error.empty{/lang}
+                                       {else}  
+                                               {lang}wcf.acp.customOption.error.{$errorType[$option->optionName]}{/lang}
+                                       {/if}
+                               </small>
+                       {/if}
+               </dd>
+       </dl>
+{/foreach}
diff --git a/com.woltlab.wcf/templates/email_contact.tpl b/com.woltlab.wcf/templates/email_contact.tpl
new file mode 100644 (file)
index 0000000..40335f9
--- /dev/null
@@ -0,0 +1,9 @@
+{if $mimeType === 'text/plain'}
+{capture assign='content'}{lang}wcf.contact.mail.plaintext{/lang}{/capture}
+{include file='email_plaintext'}
+{else}
+       {capture assign='content'}
+       {lang}wcf.contact.mail.html{/lang}
+       {/capture}
+       {include file='email_html'}
+{/if}
index ce7d64058ade0dafc8b5e9cf026573fa1b46620f..5686bfe5262c6638faf50659b4fb20ca572e0df1 100644 (file)
@@ -1,6 +1,14 @@
 <?php
 namespace wcf\data\contact\option;
+use wcf\data\contact\recipient\ContactRecipient;
 use wcf\data\custom\option\CustomOptionAction;
+use wcf\system\email\Email;
+use wcf\system\email\Mailbox;
+use wcf\system\email\mime\MimePartFacade;
+use wcf\system\email\mime\RecipientAwareTextMimePart;
+use wcf\system\language\LanguageFactory;
+use wcf\system\mail\Mail;
+use wcf\system\option\ContactOptionHandler;
 
 /**
  * Executes contact option related actions.
@@ -34,4 +42,48 @@ class ContactOptionAction extends CustomOptionAction {
         * @inheritDoc
         */
        protected $permissionsUpdate = ['admin.contact.canManageContactForm'];
+       
+       /**
+        * Sends an email to the selected recipient.
+        */
+       public function send() {
+               $defaultLanguage = LanguageFactory::getInstance()->getDefaultLanguage();
+               
+               $recipient = new ContactRecipient($this->parameters['recipientID']);
+               /** @var ContactOptionHandler $optionHandler */
+               $optionHandler = $this->parameters['optionHandler'];
+               
+               $options = [];
+               foreach ($optionHandler->getOptions() as $option) {
+                       /** @var ContactOption $object */
+                       $object = $option['object'];
+                       $options[] = [
+                               'isMessage' => $object->isMessage(),
+                               'title' => $object->getLocalizedName($defaultLanguage),
+                               'value' => $object->getFormattedOptionValue()
+                       ];
+               }
+               
+               // build message data
+               $messageData = [
+                       'options' => $options,
+                       'recipient' => $recipient,
+                       'name' => $this->parameters['name']
+               ];
+               
+               // build mail
+               $email = new Email();
+               $email->addRecipient(new Mailbox($recipient->email));
+               $email->setSubject($defaultLanguage->get('wcf.contact.mail.subject'));
+               $email->setBody(new MimePartFacade([
+                       new RecipientAwareTextMimePart('text/html', 'email_contact', 'wcf', $messageData),
+                       new RecipientAwareTextMimePart('text/plain', 'email_contact', 'wcf', $messageData)
+               ]));
+               
+               // add reply-to tag
+               $email->setReplyTo(new Mailbox($this->parameters['email']));
+               
+               // send mail
+               $email->send();
+       }
 }
index 7f314fdbfeed986e2fa23e625d3c47e6cc462839..29276f724a3bac1656271c4e37cfdc71a553d191 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 namespace wcf\data\contact\option;
 use wcf\data\custom\option\CustomOptionEditor;
+use wcf\data\IEditableCachedObject;
+use wcf\system\cache\builder\ContactOptionCacheBuilder;
 
 /**
  * Provides functions to edit contact recipients.
@@ -15,9 +17,16 @@ use wcf\data\custom\option\CustomOptionEditor;
  * @method             ContactOption   getDecoratedObject()
  * @mixin              ContactOption
  */
-class ContactOptionEditor extends CustomOptionEditor {
+class ContactOptionEditor extends CustomOptionEditor implements IEditableCachedObject {
        /**
         * @inheritDoc
         */
        protected static $baseClass = ContactOption::class;
+       
+       /**
+        * @inheritDoc
+        */
+       public static function resetCache() {
+               ContactOptionCacheBuilder::getInstance()->reset();
+       }
 }
index cb78bc7865968dad88c725baffad929b6e67ffda..9ce59138459bd7585261dc31c69c1f00363878fa 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\data\contact\recipient;
 use wcf\data\DatabaseObject;
+use wcf\system\WCF;
 
 /**
  * Represents a contact recipient.
@@ -36,7 +37,7 @@ class ContactRecipient extends DatabaseObject {
         * @inheritDoc
         */
        public function __toString() {
-               return $this->name;
+               return WCF::getLanguage()->get($this->name);
        }
        
        /**
index efeb6646fbfcc752ae14300c75916cce0b90dd66..1ec04892f5c045c3ff39926a9065081de01b4c5c 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\data\custom\option;
+use wcf\data\language\Language;
 use wcf\data\option\Option;
 use wcf\system\bbcode\MessageParser;
 use wcf\system\bbcode\SimpleMessageParser;
@@ -71,6 +72,20 @@ abstract class CustomOption extends Option {
                $this->optionValue = $value;
        }
        
+       /**
+        * Attempts to return the localized option name.
+        * 
+        * @param       Language        $language
+        * @return      string
+        */
+       public function getLocalizedName(Language $language) {
+               if (preg_match('~^wcf\.contact\.option\d+$~', $this->optionTitle)) {
+                       return $language->get($this->optionTitle);
+               }
+               
+               return $this->optionTitle;
+       }
+       
        /**
         * Returns the formatted value of this option.
         *
@@ -79,7 +94,7 @@ abstract class CustomOption extends Option {
        public function getFormattedOptionValue() {
                switch ($this->optionType) {
                        case 'boolean':
-                               return WCF::getLanguage()->get('wcf.acp.option.optionType.boolean.'.($this->optionValue ? 'yes' : 'no'));
+                               return WCF::getLanguage()->get('wcf.acp.customOption.optionType.boolean.'.($this->optionValue ? 'yes' : 'no'));
                                
                        case 'date':
                                $year = $month = $day = 0;
@@ -137,4 +152,13 @@ abstract class CustomOption extends Option {
        public function canDelete() {
                return !$this->originIsSystem;
        }
+       
+       /**
+        * Returns true if this option represents a message-type value.
+        * 
+        * @return      boolean
+        */
+       public function isMessage() {
+               return ($this->optionType === 'textarea' || $this->optionType === 'message');
+       }
 }
diff --git a/wcfsetup/install/files/lib/form/ContactForm.class.php b/wcfsetup/install/files/lib/form/ContactForm.class.php
new file mode 100644 (file)
index 0000000..5860646
--- /dev/null
@@ -0,0 +1,177 @@
+<?php
+namespace wcf\form;
+use wcf\data\contact\option\ContactOptionAction;
+use wcf\data\contact\recipient\ContactRecipientList;
+use wcf\system\email\Mailbox;
+use wcf\system\exception\IllegalLinkException;
+use wcf\system\exception\UserInputException;
+use wcf\system\option\ContactOptionHandler;
+use wcf\system\request\LinkHandler;
+use wcf\system\WCF;
+use wcf\util\HeaderUtil;
+use wcf\util\StringUtil;
+
+/**
+ * Customizable contact form with selectable recipients.
+ * 
+ * @author     Alexander Ebert
+ * @copyright  2001-2017 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\Form
+ */
+class ContactForm extends AbstractCaptchaForm {
+       public $email = '';
+       
+       public $name = '';
+       
+       /**
+        * @inheritDoc
+        */
+       public $neededModules = ['MODULE_CONTACT_FORM'];
+       
+       /**
+        * @var ContactOptionHandler
+        */
+       public $optionHandler;
+       
+       /**
+        * recipient id
+        * @var integer
+        */
+       public $recipientID = 0;
+       
+       /**
+        * @var ContactRecipientList
+        */
+       public $recipientList;
+       
+       /**
+        * @inheritDoc
+        */
+       public function readParameters() {
+               parent::readParameters();
+               
+               $this->optionHandler = new ContactOptionHandler(false);
+               $this->optionHandler->init();
+               
+               $this->recipientList = new ContactRecipientList();
+               $this->recipientList->getConditionBuilder()->add("contact_recipient.isDisabled = ?", [0]);
+               $this->recipientList->readObjects();
+               
+               if (count($this->recipientList) < 0) {
+                       throw new IllegalLinkException();
+               }
+       }
+       
+       public function readFormParameters() {
+               parent::readFormParameters();
+               
+               $this->optionHandler->readUserInput($_POST);
+               
+               if (isset($_POST['email'])) $this->email = StringUtil::trim($_POST['email']);
+               if (isset($_POST['name'])) $this->name = StringUtil::trim($_POST['name']);
+               if (isset($_POST['recipientID'])) $this->recipientID = intval($_POST['recipientID']);
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function validate() {
+               // validate file options
+               $optionHandlerErrors = $this->optionHandler->validate();
+               
+               parent::validate();
+               
+               if (!empty($optionHandlerErrors)) {
+                       throw new UserInputException('options', $optionHandlerErrors);
+               }
+               
+               if (empty($this->email)) {
+                       throw new UserInputException('email');
+               }
+               else {
+                       try {
+                               new Mailbox($this->email);
+                       }
+                       catch (\DomainException $e) {
+                               throw new UserInputException('email', 'invalid');
+                       }
+               }
+               
+               if (empty($this->name)) {
+                       throw new UserInputException('name');
+               }
+               
+               $recipients = $this->recipientList->getObjects();
+               if (count($recipients) === 1) {
+                       $this->recipientID = reset($recipients)->recipientID;
+               }
+               else {
+                       if (!$this->recipientID) {
+                               throw new UserInputException('recipientID');
+                       }
+                       
+                       $isValid = false;
+                       foreach ($recipients as $recipient) {
+                               if ($this->recipientID == $recipient->recipientID) {
+                                       $isValid = true;
+                                       break;
+                               }
+                       }
+                       
+                       if (!$isValid) {
+                               throw new UserInputException('recipientID', 'invalid');
+                       }
+               }
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function readData() {
+               parent::readData();
+               
+               if (empty($_POST) && WCF::getUser()->userID) {
+                       $this->email = WCF::getUser()->email;
+                       $this->name = WCF::getUser()->username;
+               }
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function save() {
+               parent::save();
+               
+               $this->objectAction = new ContactOptionAction([], 'send', [
+                       'email' => $this->email,
+                       'name' => $this->name,
+                       'optionHandler' => $this->optionHandler,
+                       'recipientID' => $this->recipientID
+               ]);
+               $this->objectAction->executeAction();
+               
+               // call saved event
+               $this->saved();
+               
+               HeaderUtil::delayedRedirect(
+                       LinkHandler::getInstance()->getLink(''),
+                       WCF::getLanguage()->get('wcf.contact.success')
+               );
+               exit;
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function assignVariables() {
+               parent::assignVariables();
+               
+               WCF::getTPL()->assign([
+                       'email' => $this->email,
+                       'name' => $this->name,
+                       'options' => $this->optionHandler->getOptions(),
+                       'recipientList' => $this->recipientList
+               ]);
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/cache/builder/ContactOptionCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ContactOptionCacheBuilder.class.php
new file mode 100644 (file)
index 0000000..f45244f
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+namespace wcf\system\cache\builder;
+use wcf\data\contact\option\ContactOptionList;
+
+/**
+ * Caches contact options.
+ * 
+ * @author     Alexander Ebert
+ * @copyright  2001-2017 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\System\Cache\Builder
+ */
+class ContactOptionCacheBuilder extends AbstractCacheBuilder {
+       /**
+        * @inheritDoc
+        */
+       public function rebuild(array $parameters) {
+               $list = new ContactOptionList();
+               $list->sqlSelects = "CONCAT('contactOption', CAST(contact_option.optionID AS CHAR)) AS optionName";
+               $list->readObjects();
+               
+               return $list->getObjects();
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/option/ContactOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/ContactOptionHandler.class.php
new file mode 100644 (file)
index 0000000..b49dac8
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+namespace wcf\system\option;
+use wcf\system\cache\builder\ContactOptionCacheBuilder;
+
+class ContactOptionHandler extends CustomOptionHandler {
+       /**
+        * @inheritDoc
+        */
+       protected function readCache() {
+               $this->cachedOptions = ContactOptionCacheBuilder::getInstance()->getData();
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/option/CustomOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/CustomOptionHandler.class.php
new file mode 100644 (file)
index 0000000..948b331
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+namespace wcf\system\option;
+use wcf\data\custom\option\CustomOption;
+use wcf\data\option\Option;
+use wcf\system\exception\NotImplementedException;
+use wcf\system\exception\UserInputException;
+
+abstract class CustomOptionHandler extends OptionHandler {
+       /**
+        * Gets all options and option categories from cache.
+        */
+       protected function readCache() {
+               throw new NotImplementedException();
+               
+               $this->cachedOptions = FileOptionCacheBuilder::getInstance()->getData();
+       }
+       
+       /**
+        * Initializes active options.
+        */
+       public function init() {
+               if (!$this->didInit) {
+                       // get active options
+                       foreach ($this->cachedOptions as $option) {
+                               if ($this->checkOption($option)) {
+                                       $this->options[$option->optionName] = $option;
+                               }
+                       }
+                       
+                       // mark options as initialized
+                       $this->didInit = true;
+               }
+       }
+       
+       /**
+        * Returns the parsed options.
+        *
+        * @return      array
+        */
+       public function getOptions() {
+               $parsedOptions = [];
+               foreach ($this->options as $option) {
+                       $parsedOptions[] = $this->getOption($option->optionName);
+               }
+               
+               return $parsedOptions;
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function readData() {
+               /** @var CustomOption $option */
+               foreach ($this->options as $option) {
+                       if (!isset($this->optionValues[$option->optionName])) {
+                               $this->optionValues[$option->optionName] = $option->defaultValue;
+                       }
+               }
+       }
+       
+       /**
+        * Resets the option values.
+        */
+       public function resetOptionValues() {
+               $this->optionValues = [];
+       }
+       
+       /**
+        * Returns the option values.
+        *
+        * @return      array
+        */
+       public function getOptionValues() {
+               return $this->optionValues;
+       }
+       
+       /**
+        * Sets the option values.
+        *
+        * @param       array           $values
+        */
+       public function setOptionValues(array $values) {
+               $this->optionValues = $values;
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function getOption($optionName) {
+               $optionData = parent::getOption($optionName);
+               
+               if (isset($this->optionValues[$optionName])) {
+                       /** @noinspection PhpUndefinedMethodInspection */
+                       $optionData['object']->setOptionValue($this->optionValues[$optionName]);
+               }
+               
+               return $optionData;
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       protected function validateOption(Option $option) {
+               /** @var CustomOption $option */
+               
+               parent::validateOption($option);
+               
+               if ($option->required && $option->optionType != 'boolean' && empty($this->optionValues[$option->optionName])) {
+                       throw new UserInputException($option->optionName);
+               }
+       }
+}
index 02b1ae1a77393a05291b267e3400d075e38c15cd..1a92d632f1497c60f120d25d13949fc9db67d6a6 100644 (file)
@@ -275,3 +275,7 @@ input {
                width: 100%;
        }
 }
+
+.customOptionRequired {
+       color: rgba(204, 0, 1, 1) !important;
+}
index f89c0e8515843365434f355e0752c1556b8d5bfd..bb10d654cd1281c480675c1aae6b74e1addec23e 100644 (file)
@@ -2341,10 +2341,31 @@ Fehler sind beispielsweise:
        </category>
        
        <category name="wcf.contact">
+               <item name="wcf.contact.data"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} Anfrage]]></item>
+               <item name="wcf.contact.mail.subject"><![CDATA[Neue Nachricht über das Kontakt-Formular]]></item>
+               <item name="wcf.contact.mail.plaintext"><![CDATA[Hallo,
+
+„{@$name}“ hat {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} über das Kontakt-Formular auf der Website {@PAGE_TITLE|language} [URL:{link isEmail=true}{/link}] folgende Nachricht gesandt:
+
+{foreach from=$options item=option}
+{@$option['title']}:{if !$option['isMessage']} {@$option['value']}{else}
+{@$option['value']}{/if}
+{/foreach}]]></item>
+               <item name="wcf.contact.mail.html"><![CDATA[<h2>Hallo,</h2>
+
+<p>„{$name}“ hat {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} über das Kontakt-Formular auf Website <a href="{link isEmail=true}{/link}">{PAGE_TITLE|language}</a> folgende Nachricht gesandt:</p>
+
+{foreach from=$options item=option}
+<p><strong>{@$option['title']}:</strong>{if !$option['isMessage']} {@$option['value']}{else}
+{@$option['value']|newlineToBreak}{/if}</p>
+{/foreach}]]></item>
                <item name="wcf.contact.option1"><![CDATA[Betreff]]></item>
                <item name="wcf.contact.optionDescription1"><![CDATA[Kurze, prägnante Beschreibung der Anfrage.]]></item>
                <item name="wcf.contact.option2"><![CDATA[Nachricht]]></item>
                <item name="wcf.contact.recipient.name1"><![CDATA[Administrator]]></item>
+               <item name="wcf.contact.sender"><![CDATA[Absender]]></item>
+               <item name="wcf.contact.sender.information"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} Angaben]]></item>
+               <item name="wcf.contact.success"><![CDATA[Ihre Nachricht wurde erfolgreich versandt.]]></item>
        </category>
        
        <category name="wcf.date">
index 1ee961f75e9b0340eaa042e0a717323ab8f1b5e6..e36da42cc9d6299accebaa5cc125e19a61b3cf4b 100644 (file)
@@ -2273,10 +2273,38 @@ Errors are:
        </category>
        
        <category name="wcf.contact">
+               <item name="wcf.contact.data"><![CDATA[Your Data]]></item>
+               <item name="wcf.contact.mail.subject"><![CDATA[Neue Nachricht über das Kontakt-Formular]]></item>
+               <item name="wcf.contact.mail.plaintext"><![CDATA[Hello,
+
+„{@$name}“ sent you a message on {@PAGE_TITLE|language} via the contact form:
+
+{foreach from=$options item=option}
+{@$option['title']}:{if !$option['isMessage']} {@$option['value']}{else}
+{@$option['value']}{/if}
+{/foreach}]]></item>
+               <item name="wcf.contact.mail.html"><![CDATA[<h2>Hello,</h2>
+
+<p>„{$name}“ sent you a message on <a href="{link isEmail=true}{/link}">{PAGE_TITLE|language}</a> via the contact form:</p>
+
+{foreach from=$options item=option}
+<p><strong>{@$option['title']}:</strong>{if !$option['isMessage']} {@$option['value']}{else}
+{@$option['value']|newlineToBreak}{/if}</p>
+{/foreach}]]></item>
                <item name="wcf.contact.option1"><![CDATA[Subject]]></item>
                <item name="wcf.contact.optionDescription1"><![CDATA[Short and precise description of your inquiry.]]></item>
                <item name="wcf.contact.option2"><![CDATA[Message]]></item>
                <item name="wcf.contact.recipient.name1"><![CDATA[Administrator]]></item>
+               <item name="wcf.contact.sender"><![CDATA[Sender]]></item>
+               <item name="wcf.contact.sender.information"><![CDATA[Your Inquiry]]></item>
+               <item name="wcf.contact.success"><![CDATA[Message has been sent.]]></item>
+       </category>
+       
+       <category name="wcf.contact">
+               <item name="wcf.contact.option1"><![CDATA[Subject]]></item>
+               <item name="wcf.contact.optionDescription1"><![CDATA[]]></item>
+               <item name="wcf.contact.option2"><![CDATA[Message]]></item>
+               <item name="wcf.contact.recipient.name1"><![CDATA[Administrator]]></item>
        </category>
        
        <category name="wcf.acp.contact">