瀏覽代碼

custom emailToSender after submitting contact

Olivier Massot 5 年之前
父節點
當前提交
336bec971a

+ 0 - 3
ot_templating/Configuration/TypoScript/setup.txt

@@ -15,9 +15,6 @@
     config.debug = 1
 [end]
 
-[applicationContext == Production*]
-[end]
-
 config.contentObjectExceptionHandler = 0
 
 # **** Configuration générale ****

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

@@ -27,7 +27,7 @@ finishers:
   -
     identifier: EmailToSender
     options:
-      subject: 'Bonjour / Votre message a bien été envoyé.'
+      subject: 'Votre demande de contact a bien été prise en compte.'
       recipientAddress: '{mail}'
       recipientName: '{first-name} {last-name}'
       senderAddress: ne_pas_repondre@opentalent.fr
@@ -37,6 +37,7 @@ finishers:
       blindCarbonCopyAddress: ''
       format: html
       attachUploads: 'false'
+      templatePathAndFilename: 'EXT:ot_templating/Resources/Private/Templates/EmailToSender.html'
   -
     identifier: Confirmation
     options:

+ 63 - 0
ot_templating/Resources/Private/Templates/Forms/EmailToSender.html

@@ -0,0 +1,63 @@
+{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+    <title></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta name="format-detection" content="telephone=no">
+</head>
+<body>
+
+    <p>Bonjour,</p>
+
+    <p>Votre demande de contact a bien été prise en compte.
+        Vous pouvez trouver ci-dessous un récapitulatif de cette demande:</p>
+
+    <table width="600" cellpadding="0" cellspacing="0" border="0">
+        <formvh:renderAllFormValues renderable="{form.formDefinition}" as="formValue">
+            <tr>
+                <td width="600" valign="top" align="left">{formvh:translateElementProperty(element: formValue.element, property: 'label')}</td>
+                <td width="600" valign="top" align="left">
+                    <f:if condition="{formValue.value}">
+                        <f:then>
+                            <f:if condition="{formValue.isMultiValue}">
+                                <f:then>
+                                    <table cellspacing="0" border="0">
+                                        <f:for each="{formValue.processedValue}" as="value">
+                                            <tr>
+                                                <td>{value}</td>
+                                            </tr>
+                                        </f:for>
+                                    </table>
+                                </f:then>
+                                <f:else>
+                                    <table cellspacing="0" border="0">
+                                        <tr>
+                                            <td><f:format.nl2br>{formValue.processedValue}</f:format.nl2br></td>
+                                        </tr>
+                                    </table>
+                                </f:else>
+                            </f:if>
+                        </f:then>
+                        <f:else>
+                            -
+                        </f:else>
+                    </f:if>
+                </td>
+            </tr>
+        </formvh:renderAllFormValues>
+    </table>
+
+    <p>Nous vous recontacterons dans les plus brefs délais afin de vous apporter une réponse.</p>
+
+    <p>Bien cordialement.</p>
+    <p>La direction</p>
+
+    <p>
+        ----------------------------------------------
+        Cet e-mail a été envoyé automatiquement, merci de ne pas y répondre."
+    </p>
+
+</body>
+</html>