Browse Source

xclass the form email finisher

Olivier Massot 2 years ago
parent
commit
776c682098

+ 10 - 1
doc/historic/upgrade_v11.md

@@ -76,7 +76,7 @@ A priori pas de blocage, la mise à jour des extensions sera à faire en même t
 
     touch public/typo3conf/ENABLE_INSTALL_TOOL
 
-* je me rend à l'adresse `https://sub.test5.opentalent.fr/typo3/install.php`
+* je me rends à l'adresse `https://sub.test5.opentalent.fr/typo3/install.php`
 * je lance la maj de la structure de la DB
 * je lance l'upgrade wizard, et j'exécute toutes les tâches
 * je reset les préférences du backend user
@@ -88,3 +88,12 @@ A priori pas de blocage, la mise à jour des extensions sera à faire en même t
     sh cli referenceindex:update
 
 * je retire le plugin frontend-editing qui ne fonctionne pas : php7.4 composer.phar remove friendsoftypo3/frontend-editing
+
+
+Up:
+
+Je renomme le fichier composer.json et je créé un symlink vers le nouveau composer.json versionné dans le repo ot_typo3 :
+
+    mv composer.json composer.json.orig
+    ln -s /var/opentalent/git/ot_typo3/composer.json ./composer.json
+    php7.4 composer.phar install

+ 22 - 0
ot_templating/Classes/XClass/Form/Finishers/EmailFinisher.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace Opentalent\OtTemplating\XClass\Form\Finishers;
+
+use Symfony\Component\Mime\Address;
+
+class EmailFinisher extends \TYPO3\CMS\Form\Domain\Finishers\EmailFinisher
+{
+    /**
+     * Get mail recipients
+     *
+     * @param string $listOption List option name
+     * @return array
+     */
+    protected function getRecipients(string $listOption): array {
+        if ($listOption === 'recipients') {
+            $address = $this->parseOption($listOption) ?? null;
+            return $address ? [new Address($address, 'Contact')] : [];
+        }
+        return parent::getRecipients($listOption);
+    }
+}

+ 1 - 1
ot_templating/Configuration/TypoScript/setup.txt

@@ -138,7 +138,7 @@ plugin.tx_form {
                 finishers {
                     0 {
                         options {
-                            recipientAddress = {$plugin.tx_ottemplating.settings.organization.email}
+                            recipients = {$plugin.tx_ottemplating.settings.organization.email}
                         }
                     }
                 }

+ 1 - 9
ot_templating/Resources/Private/Forms/Contact.form.yaml

@@ -21,8 +21,7 @@ finishers:
         - ''
       blindCarbonCopyRecipients:
         - ''
-      recipients:
-        dummy@foo.bar: Contact
+      recipients: ''
       format: html
       attachUploads: true
       translation:
@@ -167,10 +166,3 @@ renderables:
           text: 'By submitting this form, you agree that theses informations can be processed in order to contact you back and answer your demand'
           elementClassAttribute: contact-form-info
         label: ''
-      -
-        validators:
-          -
-            identifier: Hcaptcha
-        type: Hcaptcha
-        identifier: hcaptcha-1
-        label: hCaptcha

+ 3 - 0
ot_templating/ext_localconf.php

@@ -21,3 +21,6 @@ $GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['Controller/NewsController.php']['cre
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Form\Mvc\Configuration\ConfigurationManager::class] = [
     'className' => Opentalent\OtTemplating\XClass\Form\Configuration\ConfigurationManager::class
 ];
+$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Form\Domain\Finishers\EmailFinisher::class] = [
+    'className' => Opentalent\OtTemplating\XClass\Form\Finishers\EmailFinisher::class
+];