.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ================= EXT: Contact Form ================= :Created: 2010-02-18T17:33:18 :Changed by: Kai Vogel :Changed: 2012-08-10T00:08:54 :Classification: sp_bettercontact :Description: Secure Contact form with solid Spam protection. Input can be checked for length, allowed and disallowed signs and with Regex. Attackers can be locked. Admin can get detailed Spam notification. Requests can be stored into DB. Captcha support included. :Keywords: contact, formular, form, contactform, bettercontact, spam, check :Author: Kai Vogel :Email: kai.vogel@speedprogs.de :URL: http://www.speedprogs.de :Language: en |img-1| |img-2| EXT: Contact Form - sp\_bettercontact .. _EXT-Contact-Form: EXT: Contact Form ================= Extension Key: sp\_bettercontact Language: en Keywords: contact, formular, form, contactform, bettercontact, spam, check Copyright 2007-2012, Kai Vogel, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- `EXT: Contact Form 1 <#__RefHeading__596_1315448058>`_ **`Introduction 3 <#__RefHeading__26056_1632740317>`_** `What does it do? 3 <#__RefHeading__26058_1632740317>`_ `What should I have? 3 <#__RefHeading__26060_1632740317>`_ **`Screenshots 4 <#__RefHeading__26062_1632740317>`_** **`Installation 5 <#__RefHeading__26064_1632740317>`_** `Install the extension 5 <#__RefHeading__26066_1632740317>`_ `Add the Plugin to a page 5 <#__RefHeading__26068_1632740317>`_ **`Configuration 6 <#__RefHeading__26070_1632740317>`_** `Tab: General 6 <#__RefHeading__26072_1632740317>`_ `Tab: Templates 7 <#__RefHeading__26074_1632740317>`_ `Tab: Emails 8 <#__RefHeading__26076_1632740317>`_ `Tab: Spam handling 9 <#__RefHeading__26078_1632740317>`_ `Tab: Database handling 10 <#__RefHeading__26080_1632740317>`_ **`Backend 11 <#__RefHeading__26082_1632740317>`_** `Log report 11 <#__RefHeading__26084_1632740317>`_ `CSV Export 11 <#__RefHeading__26086_1632740317>`_ **`TypoScript 12 <#__RefHeading__26088_1632740317>`_** `plugin.tx\_spbettercontact\_pi1 12 <#__RefHeading__26090_1632740317>`_ `plugin.tx\_spbettercontact\_pi1.fields 14 <#__RefHeading__26092_1632740317>`_ `plugin.tx\_spbettercontact\_pi1.database 15 <#__RefHeading__26094_1632740317>`_ `Example Configuration 15 <#__RefHeading__26096_1632740317>`_ **`Page TSConfig 17 <#__RefHeading__26098_1632740317>`_** `mod.tx\_spbettercontact\_modfunc1 17 <#__RefHeading__26100_1632740317>`_ `Example Configuration 17 <#__RefHeading__26102_1632740317>`_ **`Template Marker 18 <#__RefHeading__26104_1632740317>`_** `Frontend 18 <#__RefHeading__26106_1632740317>`_ `Backend 19 <#__RefHeading__26108_1632740317>`_ **`Additional References 21 <#__RefHeading__26110_1632740317>`_** `Frontend User Session 21 <#__RefHeading__26112_1632740317>`_ **`How-to 22 <#__RefHeading__26114_1632740317>`_** `How can I define a default value? 22 <#__RefHeading__26116_1632740317>`_ `How can I use a checkbox, radio group or select field? 22 <#__RefHeading__26118_1632740317>`_ `How can I use the Captcha support? 22 <#__RefHeading__26120_1632740317>`_ `How can I configure my database fields? 23 <#__RefHeading__26122_1632740317>`_ `How can I disable the emailing? 23 <#__RefHeading__26124_1632740317>`_ **`Appendix 24 <#__RefHeading__9406_1069964170>`_** `Known problems 24 <#__RefHeading__9408_1069964170>`_ `Bugs and features 24 <#__RefHeading__9412_1069964170>`_ **`Changelog 25 <#__RefHeading__9421_1069964170>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ This extension provides a very secure and flexible Contact form with a solid Spam protection. It detects Spam-bots, locks visitors if the try to send a lot of emails and checks the inputs with several of the following routines depending on your configuration: - Has it any input - Minimal length - Maximal length - Allowed signs - Not allowed signs - Regular Expression - Optional Captcha check Error messages can be displayed in-line above the input fields, as list above the form or at any other position you want. You can redirect the visitor to another page if the form was sent. If you don't want to redirect, the same page will be shown with a status message (shows something like “Message was sent. Thank you.”). The sender and a list of configured recipients get an HTML- or Plain- text email with specified form data. These emails and the form can be configured with templates. You can also send a notification email to the administrator if a Spam- bot or visitor tries to send a malicious email. This notification includes all given input and a lot of information about the attacker. Most TYPO3 installations are running with default UTF-8. But if you want to send your emails in a different character set you have to convert the emails. This extension allows you to configure which character set to use for emails and converts them automatically. You can try the Contact form on my website: `http://www.speedprogs.de/kontakt.html `_ .. _What-should-I-have: What should I have? ^^^^^^^^^^^^^^^^^^^ All you need to get your own Contact form with this extension are these things: - TYPO3 Version 4.5.0 or higher - PHP Version 5.2 or higher - One of these extensions if you want to use a Captcha: “sr\_freecap”, “jm\_recaptcha”, “captcha” or “mathguard” - The extension “adodb” if you want to use external database storing - Your preferred editor to modify the HTML templates - This manual beside you for the abundance of features which this extension offers :-) .. _Screenshots: Screenshots ----------- |img-3| .. _Installation: Installation ------------ There are two steps necessary to install the Better Contact extension. If you've installed other extensions in the past, it should be no problem for you. :-) .. _Install-the-extension: Install the extension ^^^^^^^^^^^^^^^^^^^^^ The Better Contact extension can be installed through the typical TYPO3 installation process using the Extension Manager. The Extension Key is “sp\_bettercontact”. .. _Add-the-Plugin-to-a-page: Add the Plugin to a page ^^^^^^^^^^^^^^^^^^^^^^^^ Create a new page in your page tree and insert a Contact form record onto it. |img-4| .. _Configuration: Configuration ------------- If you have completed the installation process, the next step is to configure your new Contact form. The Plugin controls how the form will be shown in the Frontend as well as offering some additional options. .. _Tab-General: Tab: General ^^^^^^^^^^^^ |img-5| **Success page:** Define a page where visitors will be redirected to if a request was successfully sent. **Spam page:** Define a page where bots will be redirected to if they try to send Spam (good for tracking purposes). **Too many requests:** Show this page instead of an error message if a visitor has sent too many requests. **Error page:** Define a page where visitors will be redirected to if a request results in an error. **Enable Log:** Use build in log table to store each successfully sent request. **Log IP address:** Log users IP address also (please check if this is allowed in your country). .. _Tab-Templates: Tab: Templates ^^^^^^^^^^^^^^ |img-6| **Form template:** Define a HTML-template for the form (you can find some examples in “res/templates/examples/” in extension's main directory). **Email template:** Define a template for the emails (this could be the same like the form template if it contains all required subparts). **Style sheet file:** Define a style sheet file for the form. It will be added as meta tag to the site header. **Additional language file:** Define an additional language file if you add more labels to your template or if you want to overwrite some of the default labels. **Field name prefix:** All input field names are prefixed with an automatically generated name. You can set a static one here. **Don't use default templates:** Activate this if you won't use default templates as a replacement for not configured ones (all default templates could be found in “res/templates/frontend/” in extension's main directory). **Jump to form:** The Contact form will return to the same page if the visitor input was invalid or no redirect page was defined. If this check box is activated the extension jumps directly to it's dataset instead of the top of the page. **Highlight fields:** Activate this check box if you want to highlight malicious fields with a red border (the error class marker “###ERR\_###” must be an attribute of each input field in HTML-template). **Empty form:** Clear all input fields if form was successfully sent. .. _Tab-Emails: Tab: Emails ^^^^^^^^^^^ |img-7| **Email recipients:** Define one or more email recipients for the notification email if a visitor has sent a message. **Sender:** Define a single email address for the sender of the form (it's also allowed to use this format: Contact form ). **Administrator address:** Define a single email address for the administrator of the site. He gets a notification email if a Spam-bot or a visitor tries to send a malicious message. **Return path:** Define an email address for the return path. It's mostly the same as sender or administrator. **Send emails to:** Select which persons will get an email from the Contact form if the form was “Spam-free” sent. Available are “Nobody” if you e.g. only want store the request to database, “Only to recipients”, “Only to sender” for only the user who has sent the request and “Both”. **Send emails from:** Select which email address will be set as sender in emails to the recipients. The sender of the email to the user who has sent the request is allways the configured sender email address. **Reply-to address:** Define which email address will be used as reply-to address in notification emails. **Character encoding:** Select an encoding for all emails. **Email format:** Select an email format, available are HTML and Plain-text. .. _Tab-Spam-handling: Tab: Spam handling ^^^^^^^^^^^^^^^^^^ |img-8| **Activate Captcha support:** Define, which Captcha extension will be used in the Contact form (the selected extension has to be installed to use it's functionally and the HTML-template has to be configured correctly (see marker reference in this manual. If you don't get any Captcha image with activated “sr\_freecap”, please try to disable “display\_errors” in your php.ini). **Show input in error case:** Define which fields will get their last content if the Spam check fails. **Notify administrator about Spam:** This option specifies how to notify the administrator about Spam. Available are “Nothing”, “Bot- Spam”, “User-Spam”, “Both” (the options “User-Spam” and “Both” are slow because an email will be sent every time a visitor tries to send a malicious request). **Check referrer:** If activated, the HTTP\_REFERER will be compared with current host (only enable this if most of your users use an Browser with activated referrer). **Max count of allowed mailings:** Allow visitors to send only the specified count of emails. **Waiting time:** If the specified count of mailings was reached a visitor must wait for this time (in minutes) before he can send the next emails. He will get a status message in Frontend which shows something like “ *You have already sent 10 messages. Please wait 60 minutes* ”. .. _Tab-Database-handling: Tab: Database handling ^^^^^^^^^^^^^^^^^^^^^^ |img-9| **Table name:** Define an internal or external table name to store successfully sent requests in. **Auto fill default fields:** Activate this to automatically fill the fields “pid”, “tstamp”, “crdate” and “cruser\_id” from an internal table while inserting a new row or updating a existing one. **Field configuration:** Configure your field mapping here. You can use default TypoScript to describe the mapping. .. _Backend: Backend ------- The Better Contact extension comes with a build in log table where every successfully sent request will be stored. You can analyze this log table via the Info module in TYPO3 Backend. See below, which steps are required to see the log and how you can configure the report and CSV-Export. .. _Log-report: Log report ^^^^^^^^^^ Follow the steps in the Screenshot below to open the report. |img-10| **Show:** Select if all pages or only the current will be used for the report (you can adjust the output of the report with your own Backend template. See Backend templates in “res/templates/backend/” in extension's main directory and “CSV Export” chapter below). **Period:** Select the count of days to show. **Download:** You can download the currently visible report with one click as a CSV File. .. _CSV-Export: CSV Export ^^^^^^^^^^ To export the currently visible log report click on the “CSV” button (3) show in the Screenshot above. **Tip:** You can adjust the output to your individual needs by manipulating the CSV template. Simply copy the default template from “res/templates/backend/” in extension's main directory to any target you prefer and edit it. Finally setup the new template in the Page TSConfig. To do that, go to the page properties of the root or Contact form page and add the required TypoScript configuration in the field “TSconfig” in tab “Options”. To see, which configuration is required, have a look into the “Page TSConfig – Reference” chapter in this manual. .. _TypoScript: TypoScript ---------- Most of the configuration can be done in Flexforms. Only the field configuration and optionally external database handling or the addition of new markers have to be done with TypoScript. Some fields are basically configured after installation (have a look into the file “ext\_typoscript\_setup.txt” in extension's main directory). If you want to add new fields in Frontend read this TypoScript reference and have a look to the example below the reference. .. _plugin-tx-spbettercontact-pi1: plugin.tx\_spbettercontact\_pi1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _fields: fields """""" .. container:: table-row Property fields Data type cObj Description Configuration for the form input fields. The field names must be defined in lowercase. :: fields { name_of_field { required = 1 minLength = 3 maxLength = 70 default = regex = disallowed = <>[](){}&;” allowed = default = } } Default .. _markers: markers """"""" .. container:: table-row Property markers Data type cObj Description Additional markers. You can use this for additional dynamic values in your emails or Contact form. Add this markers to your template with the marker name in uppercase: ###MARKER\_NAME### :: markers { static_marker = Static marker dynamic_marker = TEXT dynamic_marker.field = title } Default .. _formTemplate: formTemplate """""""""""" .. container:: table-row Property formTemplate Data type String / cObj Description Template file for the form. Default .. _emailTemplate: emailTemplate """"""""""""" .. container:: table-row Property emailTemplate Data type String / cObj Description Template file for the emails. Default .. _stylesheetFile: stylesheetFile """""""""""""" .. container:: table-row Property stylesheetFile Data type String / cObj Description Style sheet file for the form. Default .. _locallangFile: locallangFile """"""""""""" .. container:: table-row Property locallangFile Data type String / cObj Description Additional language file for the templates. Default .. _successRedirectPage: successRedirectPage """"""""""""""""""" .. container:: table-row Property successRedirectPage Data type String / cObj Description Redirect visitors to this page if an email was successfully sent. Default .. _errorRedirectPage: errorRedirectPage """"""""""""""""" .. container:: table-row Property errorRedirectPage Data type String / cObj Description Redirect visitors to this page if an error occurs. Default .. _spamRedirectPage: spamRedirectPage """""""""""""""" .. container:: table-row Property spamRedirectPage Data type String / cObj Description Redirect to this page if a bot tries to send Spam. Default .. _exhaustedRedirectPage: exhaustedRedirectPage """"""""""""""""""""" .. container:: table-row Property exhaustedRedirectPage Data type String / cObj Description Redirect to this page if a visitor has sent too many requests (see “messageCount”). Default .. _disableAutoTemplates: disableAutoTemplates """""""""""""""""""" .. container:: table-row Property disableAutoTemplates Data type Boolean / cObj Description Disable the usage of default templates as a replacement for not configured ones. Default FALSE (0) .. _fieldPrefix: fieldPrefix """"""""""" .. container:: table-row Property fieldPrefix Data type String / cObj Description Define your own prefix for input field names in Contact form. Default tx\_spbettercontact\_pi1- .. _formCharset: formCharset """"""""""" .. container:: table-row Property formCharset Data type String / cObj Description Optional form character set. Auto detection if not defined. Default .. _emailCharset: emailCharset """""""""""" .. container:: table-row Property emailCharset Data type String / cObj Description Character set for emails. Default .. _emailFormat: emailFormat """"""""""" .. container:: table-row Property emailFormat Data type String / cObj Description Define the email format, available are “html” and “plain”. Default html .. _allowReturnPath: allowReturnPath """"""""""""""" .. container:: table-row Property allowReturnPath Data type String / cObj Description Disable this if you have problems with the Return-path of emails. In this case also disable “forceReturnPath” in the Install-Tool. Default TRUE (1) .. _emailRecipients: emailRecipients """"""""""""""" .. container:: table-row Property emailRecipients Data type String / cObj Description Comma separated list of recipients. Default .. _emailSender: emailSender """"""""""" .. container:: table-row Property emailSender Data type String / cObj Description Email address of the sender for notification emails. Default .. _emailAdmin: emailAdmin """""""""" .. container:: table-row Property emailAdmin Data type String / cObj Description Email address of the administrator. Default .. _sendTo: sendTo """""" .. container:: table-row Property sendTo Data type String / cObj Description Specify which persons will get an email (“none”, “recipients”, “user”, “both”) Default both .. _sendFrom: sendFrom """""""" .. container:: table-row Property sendFrom Data type String / cObj Description Specify which email address will be used as sender in emails to the recipients. Available are “sender” and “user”. Default sender .. _replyTo: replyTo """"""" .. container:: table-row Property replyTo Data type String / cObj Description Add this emai as reply-to address to the notification emails. Select “user” for visitor's email address and “sender” for sender's email address. Default user .. _disableSwiftMailer: disableSwiftMailer """""""""""""""""" .. container:: table-row Property disableSwiftMailer Data type Boolean / cObj Description Disable the usage of the SwiftMailer to send mails. Default FALSE (0) .. _disableOldMailApi: disableOldMailApi """"""""""""""""" .. container:: table-row Property disableOldMailApi Data type Boolean / cObj Description Disable the usage of the old mail API. Default FALSE (0) .. _showMaliciousInput: showMaliciousInput """""""""""""""""" .. container:: table-row Property showMaliciousInput Data type String / cObj Description Select which fields will get their last content if the Spam check fails. Use “none” to clear all fields, “clean” to show only Spam-free content and “all” to show all input. Default clean .. _adminMails: adminMails """""""""" .. container:: table-row Property adminMails Data type String / cObj Description Select the level for administrator notifications. Available are “none”, “bot”, “user”, “both”. Default bot .. _messageCount: messageCount """""""""""" .. container:: table-row Property messageCount Data type Integer / cObj Description Specify how many emails one visitor is allowed to send. Default 10 .. _waitingTime: waitingTime """"""""""" .. container:: table-row Property waitingTime Data type Integer / cObj Description Time in minutes which the visitor has to wait if he has reached the max count before he can send emails again. Default 60 .. _postOnly: postOnly """""""" .. container:: table-row Property postOnly Data type Boolean / cObj Description $\_GET will be ignored and only $\_POST values will be handled if activated. Default TRUE (1) .. _useRefererCheck: useRefererCheck """"""""""""""" .. container:: table-row Property useRefererCheck Data type Boolean / cObj Description Use referer check to recognize if the form was sent from current server (HTTP\_REFERER). Default TRUE (1) .. _captchaSupport: captchaSupport """""""""""""" .. container:: table-row Property captchaSupport Data type String / cObj Description Extension key of a supported Captcha extension. Available are “sr\_freecap”, “jm\_recaptcha”, “captcha” and “mathguard”. Default .. _spamDateFormat: spamDateFormat """""""""""""" .. container:: table-row Property spamDateFormat Data type String / cObj Description Use a valid "strftime" format to display date in Spam notification. Default .. _spamTimeFormat: spamTimeFormat """""""""""""" .. container:: table-row Property spamTimeFormat Data type String / cObj Description Use a valid "strftime" format to display time in Spam notification. Default .. _enableLog: enableLog """"""""" .. container:: table-row Property enableLog Data type Boolean / cObj Description Log all valid requests into a database table. Default .. _enableIPLog: enableIPLog """"""""""" .. container:: table-row Property enableIPLog Data type Boolean / cObj Description Log IP address also (this is not allowed in some countries). Default .. _highlightFields: highlightFields """"""""""""""" .. container:: table-row Property highlightFields Data type Boolean / cObj Description Activate to add the CSS class "error" to malicious fields. Default .. _classError: classError """""""""" .. container:: table-row Property classError Data type String / cObj Description Define own class name to highlight malicious fields. Default .. _classNoError: classNoError """""""""""" .. container:: table-row Property classNoError Data type String / cObj Description Define a default class for fields without an error. Default .. _infoWrapPositive: infoWrapPositive """""""""""""""" .. container:: table-row Property infoWrapPositive Data type String / cObj Description Wrap around the status message if an email was successfully sent. Default .. _infoWrapNegative: infoWrapNegative """""""""""""""" .. container:: table-row Property infoWrapNegative Data type String / cObj Description Wrap around the status message if an email could not be sent. Default .. _database: database """""""" .. container:: table-row Property database Data type cObj Description Database configuration for internal or external tables. Please notice, that the usage of external tables need the extension “adodb” to be installed. For more information see the “TypoScript - Database configuration Reference” in this manual. :: database { table = tt_news useDefaultValues = 1 fieldconf { name = TEXT name.data = GPvar : my_prefix|name } } Default .. _browsers: browsers """""""" .. container:: table-row Property browsers Data type cObj Description List of browser names and their identifier to check if the browser matches with user agent (HTTP\_USER\_AGENT). The PHP function “preg\_match” is used to check the browser name. :: browsers { firefox { name = Mozilla Firefox ident = (Firebird)|(Firefox) } firefox30 { name = Mozilla Firefox 3.0 ident = Firefox/3.0 } } Default .. _systems: systems """"""" .. container:: table-row Property systems Data type cObj Description List of systems names and their identifier to check if the system matches with user agent (HTTP\_USER\_AGENT). The PHP function “preg\_match” is used to check the system name. :: systems { ubuntu { name = Ubuntu ident = Ubuntu } ubuntu904 { name = Ubuntu 9.04 (Jaunty Jackalope) ident = Ubuntu/9\.04 } } Default .. _preUserFunc: preUserFunc """"""""""" .. container:: table-row Property preUserFunc Data type String / cObj Description This option allows you to configure a userFunc which will be called before all checks and any rendering. Default .. _submitUserFunc: submitUserFunc """""""""""""" .. container:: table-row Property submitUserFunc Data type String / cObj Description This option allows you to configure a userFunc which will be called if the form was submitted. Default .. _postUserFunc: postUserFunc """""""""""" .. container:: table-row Property postUserFunc Data type String / cObj Description This option allows you to configure a userFunc which will be called after all checks and rendering before redirect or final output. Default .. ###### END~OF~TABLE ###### [plugin.tx\_spbettercontact\_pi1] .. _plugin-tx-spbettercontact-pi1-fields: plugin.tx\_spbettercontact\_pi1.fields ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _required: required """""""" .. container:: table-row Property required Data type Boolean / cObj Description Is it necessary that this field has input? Default FALSE (0) .. _minLength: minLength """"""""" .. container:: table-row Property minLength Data type Integer / cObj Description Minimal length of the input. Default 0 .. _maxLength: maxLength """"""""" .. container:: table-row Property maxLength Data type Integer / cObj Description Maximal length of the input. Default 0 .. _default: default """"""" .. container:: table-row Property default Data type String / cObj Description Default value of this field. Default .. _regex: regex """"" .. container:: table-row Property regex Data type String / cObj Description Check the input of this field with this Regular Expression. (preg\_match is used) Default .. _disallowed: disallowed """""""""" .. container:: table-row Property disallowed Data type String / cObj Description This signs are not allowed in input. Default .. _allowed: allowed """"""" .. container:: table-row Property allowed Data type String / cObj Description Only this signs are allowed in input. Default .. ###### END~OF~TABLE ###### [plugin.tx\_spbettercontact\_pi1.fields.] .. _plugin-tx-spbettercontact-pi1-database: plugin.tx\_spbettercontact\_pi1.database ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _driver: driver """""" .. container:: table-row Property driver Data type String / cObj Description Driver for an external database engine. **Notice:** The extension will automatically activate and use the external database feature if you define one or more of these options: “driver”, “host”, “port”, “username”, “password”, “database”. Default .. _host: host """" .. container:: table-row Property host Data type String / cObj Description Hostname or IP of an external database server. Default .. _port: port """" .. container:: table-row Property port Data type String / cObj Description Port of an external database server. Default .. _username: username """""""" .. container:: table-row Property username Data type String / cObj Description Username to login on an external database server. Default .. _password: password """""""" .. container:: table-row Property password Data type String / cObj Description Password to login on an external database server. Default .. _database: database """""""" .. container:: table-row Property database Data type String / cObj Description Database name which will be used on an external database server. Default .. _table: table """"" .. container:: table-row Property table Data type String / cObj Description Internal or external table name. Default .. _force-charset: force\_charset """""""""""""" .. container:: table-row Property force\_charset Data type String / cObj Description Convert values to this charset before inserting them into an external table. Default .. _idField: idField """"""" .. container:: table-row Property idField Data type String / cObj Description Field which is used to identify rows in the configured table. Is used to check if an entry already exists. If so, the row will only be updated and no new row will be inserted. **Notice:** This feature will only only be used if the field “uid” is configured in the “fieldconf” of your TypoScript setup. Default uid .. _useDefaultValues: useDefaultValues """""""""""""""" .. container:: table-row Property useDefaultValues Data type Boolean / cObj Description Insert default values for the fields “pid”, “tstamp”, “crdate” and “cruser\_id”. These fields must not be configured in the “fieldconf” if this option is activated. Default .. _fieldconf: fieldconf """"""""" .. container:: table-row Property fieldconf Data type cObj Description Configuration of the fields to insert into a new or existing row in the configured table. Please notice, that “my\_prefix” stands for the automatically generated or manually configured field name prefix of the Contact form. The prefix can be configured via TypoScript or Flexform (see example in the “TypoScript - Example configuration” chapter of this manual). :: fieldconf { name = TEXT name.data = GPvar : my_prefix|name email = TEXT email.data = GPvar : my_prefix|email newsletter = TEXT newsletter.value = 1 } Default .. ###### END~OF~TABLE ###### [plugin.tx\_spbettercontact\_pi1.database] .. _Example-Configuration: Example Configuration ^^^^^^^^^^^^^^^^^^^^^ :: plugin.tx_spbettercontact_pi1 { formTemplate = fileadmin/your-template-file.html emailTemplate = fileadmin/your-template-file.html stylesheetFile = fileadmin/your-stlesheet-file.css emailRecipients = recipient@your-domain.com emailSender = Contact form emailAdmin = admin@your-domain.com replyTo = user emailCharset = utf-8 showMaliciousInput = clean adminMails = bot messageCount = 10 waitingTime = 60 fields { name { required = 1 minLength = 3 maxLength = 70 regex = disallowed = 0123456789<>(){}!?%&§$/*+-\ allowed = } email { required = 1 minLength = 5 maxLength = 70 regex = /^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}/ disallowed = allowed = } message { required = 1 minLength = 10 maxLength = 2000 regex = disallowed = <>& allowed = } privacy { required = 1 minLength = maxLength = regex = disallowed = allowed = } } database { table = tt_news useDefaultValues = 1 fieldconf { title = TEXT title.data = GPvar : tx_spbettercontact_pi1-9|name bodytext = TEXT bodytext.data = GPvar : tx_spbettercontact_pi1-9|message } } } .. _Page-TSConfig: Page TSConfig ------------- With the Page TSConfig you are allowed to manipulate the Backend module with your own HTML-Templates or language file. Have a look into the file “ext\_ts\_config.txt” in extension's main directory and into the example configuration in the “Page TSConfig - Example configuration” chapter in this manual. .. _mod-tx-spbettercontact-modfunc1: mod.tx\_spbettercontact\_modfunc1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _mainTemplate: mainTemplate """""""""""" .. container:: table-row Property mainTemplate Data type String Description Template file for the log table in Backend module. Default .. _csvTemplate: csvTemplate """"""""""" .. container:: table-row Property csvTemplate Data type String Description Template file for the CSV export of the log table. Default .. _stylesheetFile: stylesheetFile """""""""""""" .. container:: table-row Property stylesheetFile Data type String Description Style sheet file for the log table in Backend module. Default .. _javascriptFile: javascriptFile """""""""""""" .. container:: table-row Property javascriptFile Data type String Description Javascript file for the log table in Backend module. Default .. _locallangFile: locallangFile """"""""""""" .. container:: table-row Property locallangFile Data type String Description Language file for the log table and CSV file. Default .. _disableAutoTemplates: disableAutoTemplates """""""""""""""""""" .. container:: table-row Property disableAutoTemplates Data type Boolean Description Disable the usage of default templates as a replacement for not configured ones. Default FALSE (0) .. _dateFormat: dateFormat """""""""" .. container:: table-row Property dateFormat Data type String Description Use a valid "strftime" format to display date in log table and CSV. Default .. ###### END~OF~TABLE ###### [mod.tx\_spbettercontact\_modfunc1] .. _Example-Configuration: Example Configuration ^^^^^^^^^^^^^^^^^^^^^ :: mod.tx_spbettercontact_modfunc1 { mainTemplate = fileadmin/your-backend-template.html csvTemplate = fileadmin/your-csv-template.html stylesheetFile = fileadmin/your-stylesheet.html locallangFile = fileadmin/your-locallang-file.xml dateFormat = %Y-%m-%d } .. _Template-Marker: Template Marker --------------- .. _Frontend: Frontend ^^^^^^^^ Available markers for Frontend templates (see examples in “res/templates/examples/” in extension's main directory): .. ### BEGIN~OF~TABLE ### .. _URL-SELF: ###URL\_SELF### """"""""""""""" .. container:: table-row Property ###URL\_SELF### Description Form action. Required! Example action="###URL\_SELF###" .. _INFO: ###INFO### """""""""" .. container:: table-row Property ###INFO### Description Displays status messages (e.g. if message was sent or not). Example .. _HIDDEN: ###HIDDEN### """""""""""" .. container:: table-row Property ###HIDDEN### Description Hidden fields for Spam detection. Required! Example .. _SUBMIT: ###SUBMIT### """""""""""" .. container:: table-row Property ###SUBMIT### Description Name of the submit button. Required! Example name="###SUBMIT###" .. _SUBMIT-VALUE: ###SUBMIT\_VALUE### """"""""""""""""""" .. container:: table-row Property ###SUBMIT\_VALUE### Description Value of the submit button. Example value=”###SUBMIT\_VALUE###” .. _CHARSET: ###CHARSET### """"""""""""" .. container:: table-row Property ###CHARSET### Description Character set of the form. Required! Example accept-charset="###CHARSET###" .. _ANCHOR: ###ANCHOR### """""""""""" .. container:: table-row Property ###ANCHOR### Description Adds an anchor to the form to jump directly to. Example .. _MESSAGES: ###MESSAGES### """""""""""""" .. container:: table-row Property ###MESSAGES### Description Display all error messages as unordered list (
    ). Example .. _MSG-FIELDNAME: ###MSG\_### """""""""""""""""""""" .. container:: table-row Property ###MSG\_### Description Display a single message for one field. Example

    ###MSG\_EMAIL###

    .. _VALUE-FIELDNAME: ###VALUE\_### """""""""""""""""""""""" .. container:: table-row Property ###VALUE\_### Description Default or old value of a single input field. Example value=”###VALUE\_EMAIL###” .. _CHECKED-FIELDNAME: ###CHECKED\_### """""""""""""""""""""""""" .. container:: table-row Property ###CHECKED\_### Description Checked state of a check box or radio button. (See example in file “res/templates/examples/checkbox\_radiobutton\_select.html” in extension's main directory) Example ###CHECKED\_PRIVACY### .. _CHECKED-FIELDNAME-LABEL: ###CHECKED\_\_[