.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt =============================== EXT: Email Address Subscription =============================== :Author: Stanislas Rolland :Created: 2012-04-19T19:27:19 :Changed by: Stanislas Rolland :Changed: 2018-02-10T13:02:22.320000000 :Classification: sr_email_subscribe :Keywords: forAdmins, forIntermediates, tt_address, direct_mail :Author: Stanislas Rolland :Email: typo3(arobas)sjbr.ca :Info 4: :Language: en |img-1| |img-2| EXT: Email Address Subscription - sr\_email\_subscribe .. _EXT-Email-Address-Subscription: EXT: Email Address Subscription =============================== Extension Key: sr\_email\_subscribe Language: en Keywords: forAdmins, forIntermediates, tt\_address, direct\_mail Copyright 2000-2018, Stanislas Rolland, 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: Email Address Subscription 1 <#__RefHeading__2180_116188488>`_ **`Introduction 3 <#__RefHeading__2182_116188488>`_** `What does it do? 3 <#__RefHeading__2184_116188488>`_ `What's new in version 5 3 <#__RefHeading__4755_828479407>`_ `What's new in version 4 3 <#__RefHeading__6065_221449167>`_ `Requirements 3 <#__RefHeading__6381_1627904414>`_ `Support 4 <#__RefHeading__2188_116188488>`_ `Credits 4 <#__RefHeading__2190_116188488>`_ **`Administration 5 <#__RefHeading__2198_116188488>`_** `Front End Rendering 5 <#__RefHeading__2200_116188488>`_ `Localization 7 <#__RefHeading__2202_116188488>`_ **`Configuration 8 <#__RefHeading__2204_116188488>`_** `Configuration steps 8 <#__RefHeading__2206_116188488>`_ `Upgrading from version 4+ to version 5+ 8 <#__RefHeading__4856_828479407>`_ `Upgrading to version 4+ 8 <#__RefHeading__2208_116188488>`_ `Extension configuration variables 9 <#__RefHeading__2210_116188488>`_ `TypoScript Constants 9 <#__RefHeading__2212_116188488>`_ `TypoScript Setup 10 <#__RefHeading__2214_116188488>`_ `Sending invitations 10 <#__RefHeading__2218_116188488>`_ `Using frames 10 <#__RefHeading__2220_116188488>`_ `Reducing the length of URL's 10 <#__RefHeading__2222_116188488>`_ `Using Captcha 11 <#__RefHeading__4754_738236175>`_ `Silently not sending infomail to a non-subscribed email address 11 <#__RefHeading__1289_929537368>`_ **`Tutorial: Adding custom fields to the subscription form 12 <#__RefHeading__2224_116188488>`_** `Extend the tt\_address table 12 <#__RefHeading__2226_116188488>`_ `Add the fields in the HTML template 12 <#__RefHeading__2228_116188488>`_ `Modify the TS template Constants and Setup 13 <#__RefHeading__2230_116188488>`_ `Add the language labels for the new fields 13 <#__RefHeading__2232_116188488>`_ **`Change Log 14 <#__RefHeading__2238_116188488>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ The Email Address Subscription extension is an email-based subscription application that allows to subscribe to Direct Mail categories with an email address, without having to register as a frontend user. The Email Address Subscription extension is based on the features of extension Front End User Registration (sr\_feuser\_register). .. _What-s-new-in-version-5: What's new in version 5 ^^^^^^^^^^^^^^^^^^^^^^^ - Requires TYPO3 CMS 7 LTS. - Is enabled in TYPO3 CMS 8 LTS. - With TYPO3 CMS 8 LTS, the extension assumes that the image field (and any other user-defined file-referencing field) of the Address (tt\_address) record was migrated to FAL; the default upload folder is **2:/tx\_sremailsubscribe/** in TYPO3 CMS 8 LTS and **uploads/tx\_** **sremailsubscribe** in TYPO3 CMS 7 LTS. - With TYPO3 CMS 8 LTS,the base extension uses the TYPO3 Doctrine-based database API. - In version 5.1.0, HTML5 input types are supported and the default HTML template is modified accordingly. In order to support the date input type, the following changes are introduced:- the TS constants and setup variables dateFormat and dateSplit are dropped;- the rendering format of dates in input forms is left to the browser;- the rendering format of dates in other contexts is specified in the locallang.xlf file as index dateFormat, thus allowing for varying formats depending on language. .. _What-s-new-in-version-4: What's new in version 4 ^^^^^^^^^^^^^^^^^^^^^^^ - Requires TYPO3 6.2.4+ and PHP 5.3+. - Requires extensions Front End User Registration (sr\_feuser\_register) 4+. - Is enabled in TYPO3 CMS 7. - Is completely refactored: all API is modified with NO backwards compatibility. - Localization files are converted and moved as follows: - locallang.xml => Resources/Private/Language/locallang\_db\_layout.xlf - locallang\_db.xml => Resources/Private/Language/locallang\_db.xlf - pi1/locallang.xml => Resources/Private/Language/locallang.xlf Localization files on the translation server will need to be moved/copied/redirected accordingly. - Uses extbase localization: The TypoScript configuration may need to be changed. In TypoScript setup, plugin.tx\_sremailsubscribe\_pi1.salutation and plugin.tx\_sremailsubscribe\_pi1.\_LOCAL\_LANG should become plugin.tx\_sremailsubscribe.settings.salutation and plugin.tx\_sremailsubscribe.\_LOCAL\_LANG - Default styles are removed from default TypoScript setup and moved to an external file. A new static template may be included in order to include the default styles on the frontend page. - Adds template subpart ###TEMPLATE\_INVALID\_TOKEN###. - Adds markers ###MAXLENGTH\_name\_of\_field### for the maxlength attribute in forms. The value is obtained from the TCA field configuration. - On subpart ###TEMPLATE\_DELETE\_PREVIEW###, the value of the onclick attribute of the doNotSave button was changed to: 'this.form['tx\_sremailsubscribe\_pi1[cmd]'].value='edit'; return true; '. - Modifies the default value of TS constant 'onChangeCountryAttribute'. - TS constant 'pid' may be a list of page id's. The first one is used for creation of new records. .. _Requirements: Requirements ^^^^^^^^^^^^ Extension Email Address Subscription (extension key: sr\_email\_subscribe) requires TYPO3 CMS 7+. Version 5+ requires extensions Front End User Registration (sr\_feuser\_register) 5+, Address List (tt\_address) 3.2+ and Static Info Tables (static\_info\_tables) 6.4.2+ to be installed. If used in conjunction with Direct Mail, then Direct Mail 5.1+ is required. .. _Support: Support ^^^^^^^ Please see or report bugs on TYPO3 Forge: `https://forge.typo3.org/projects/extension- sr\_email\_subscribe/issues `_ .. _Credits: Credits ^^^^^^^ This extension is derived from the Front End User Admin extension of Kasper Skårhøj. The email attachment feature is an idea of Volker Graubaum < `volker.graubaum(AT)e-netconsulting.de `_ >. Thanks to `Steve Webster `_ for sharing his code for the short URL feature. .. _Administration: Administration -------------- .. _Front-End-Rendering: Front End Rendering ^^^^^^^^^^^^^^^^^^^ .. _HTML-Template: HTML Template """"""""""""" The default HTML template provided with the plugin is: :: EXT:sr_email_subscribe/Resources/Private/Templates/SubscribeHtmlTemplate.html .. _CSS-Styles: CSS Styles """""""""" Default CSS styles are defined in file in EXT:sr\_email\_subscribe/Resources/Public/StyleSheets/default.css. They may be included in the frontend by including TS template 'Email Address Subscription CSS Styles'. .. _HTML-Template-Markers: HTML Template Markers """"""""""""""""""""" The following is the list of global and main subparts markers used in the example HTML template. Global markers: ###CHARSET### = config.metaCharset or utf-8 Main subparts markers: - ###TEMPLATE\_CREATE### : template used to display the initial subscription form. - ###TEMPLATE\_CREATE\_PREVIEW### : template used to display the (optional) subscription preview form. - ###TEMPLATE\_CREATE\_SAVED### : template used to display confirmation that the subscription account was created (when email confirmation request is disabled). - ###TEMPLATE\_SETFIXED\_CREATE### : template used to display confirmation that the subscription account was created but that an email is being sent to the subscriber to complete the subscription process (when email confirmation request is enabled). - ###TEMPLATE\_INVITE### : template used to display the invitation form. - ###TEMPLATE\_INVITE\_PREVIEW### : template used to display the (recommended) invitation preview form. - ###TEMPLATE\_SETFIXED\_INVITE### : template used to display confirmation that a subscription account was created and that an invitation email has been sent to the potential subscriber to complete the subscription process or decline the invitation. - ###TEMPLATE\_INFOMAIL### : template used to display a screen that allows the subscriber to request links to be sent to his email address so that he(she) may update or terminate his(her) subscription. - ###TEMPLATE\_INFOMAIL\_SENT### : template used to display confirmation that the “infomail” message is being sent to the subscriber. - ###TEMPLATE\_EDIT### : template used to display the subscription account editing form. - ###TEMPLATE\_EDIT\_PREVIEW### : template used to display the (optional) editing preview form. - ###TEMPLATE\_EDIT\_SAVED### : template used to display confirmation that the subscription account was updated. - ###TEMPLATE\_DELETE\_PREVIEW### : template used to display the deletion confirmation form. - ###TEMPLATE\_DELETE\_SAVED### : template used to display confirmation that the subscription was terminated. - ###TEMPLATE\_SETFIXED\_OK### : template used to display confirmation that the subscription process was completed. - ###TEMPLATE\_SETFIXED\_OK\_DELETE### : template used to display confirmation that the subscription process was canceled. - ###TEMPLATE\_SETFIXED\_FAILED### : template used to display a message when the subscription or cancellation process could not be completed. - ###TEMPLATE\_AUTH#### : template used to display a link to the subscription form. - ###TEMPLATE\_NO\_PERMISSIONS### : template used to display a message when some illegal access is attempted. - ###EMAIL\_TEMPLATE\_CREATE\_SAVED\_HTML### : template for the HTML message sent to the subscriber when he has subscribed (when email confirmation request is disabled). - ###EMAIL\_TEMPLATE\_CREATE\_SAVED### : template for the plain text message sent to the subscriber when he has subscribed (when email confirmation request is disabled). - ###EMAIL\_TEMPLATE\_CREATE\_SAVED\_ADMIN### : template for the plain text notification sent to the site administrator when a visitor has subscribed (when email confirmation request is disabled). - ###EMAIL\_TEMPLATE\_EDIT\_SAVED\_HTML### : template for the HTML message sent to the subscriber when he has updated his subscription account. - ###EMAIL\_TEMPLATE\_EDIT\_SAVED### : template for the plain text message sent to the subscriber when he has updated his subscription account. - ###EMAIL\_TEMPLATE\_EDIT\_SAVED\_ADMIN### : template for the plain text notification sent to the site administrator when a subscriber has updated his subscription account. - ###EMAIL\_TEMPLATE\_SETFIXED\_CREATE\_HTML### : template for the HTML message sent to the subscriber when he has created a subscription account and need to confirm his subscription (when email confirmation request is enabled). - ###EMAIL\_TEMPLATE\_SETFIXED\_CREATE### : template for the plain text message sent to the subscriber when he has created a subscription account and need to confirm his subscription (when email confirmation request is enabled). - ###EMAIL\_TEMPLATE\_SETFIXED\_CREATE\_ADMIN### : template for the plain text notification sent to the site administrator when a subscriber has created a subscription account and needs to confirm his subscription (when email confirmation request is enabled). - ###EMAIL\_TEMPLATE\_SETFIXED\_INVITE\_HTML### : template for the HTML invitation message sent to a person for whom a subscription account has been created and requesting accept the invitation to confirm his subscription, or to decline the invitation (or ignore the message). - ###EMAIL\_TEMPLATE\_SETFIXED\_INVITE### : template for the plain text invitation message sent to a person for whom a subscription account has been created and requesting accept the invitation to confirm his subscription, or to decline the invitation (or ignore the message). - ###EMAIL\_TEMPLATE\_SETFIXED\_INVITE\_ADMIN### : template for the plain text notification sent to the site administrator when an invitation to register has been sent and the invited person needs to confirm his(her) subscription. - ###EMAIL\_TEMPLATE\_SETFIXED\_APPROVE\_HTML### : template for the HTML message sent to the subscriber when he has confirmed his subscription. - ###EMAIL\_TEMPLATE\_SETFIXED\_APPROVE### : template for the plain text message sent to the subscriber when he has confirmed his subscription. - ###EMAIL\_TEMPLATE\_SETFIXED\_APPROVE\_ADMIN### : template for the plain text notification sent to the site administrator when a subscriber has confirmed his subscription. - ###EMAIL\_TEMPLATE\_SETFIXED\_DELETE\_HTML### : template for the HTML message sent to the subscriber when he has canceled his subscription. - ###EMAIL\_TEMPLATE\_SETFIXED\_DELETE### : template for the plain text message sent to the subscriber when he has canceled his subscription. - ###EMAIL\_TEMPLATE\_SETFIXED\_DELETE\_ADMIN### : template for the plain text notification sent to the site administrator when a subscriber has canceled his subscription. - ###EMAIL\_TEMPLATE\_INFOMAIL\_HTML### : template for the HTML message sent to the subscriber when he wants to update or terminate his subscription. - ###EMAIL\_TEMPLATE\_INFOMAIL### : template for the plain text message sent to the subscriber when he wants to update or terminate his subscription. - ###EMAIL\_TEMPLATE\_INFOMAIL\_NORECORD\_HTML### : template for the HTML message sent to the subscriber when no subscription with his email was found. - ###EMAIL\_TEMPLATE\_INFOMAIL\_NORECORD### : template for the plain text message sent to the subscriber when no subscription with his email was found. - ###EMAIL\_TEMPLATE\_DELETE\_SAVED\_HTML### : template for the HTML message sent to the subscriber when he has terminated his subscription. - ###EMAIL\_TEMPLATE\_DELETE\_SAVED### : template for the plain text message sent to the subscriber when he has terminated his subscription. - ###EMAIL\_TEMPLATE\_DELETE\_SAVED\_ADMIN### : template for the plain text notification sent to the site administrator when a subscriber has terminated his subscription. .. _Localization: Localization ^^^^^^^^^^^^ .. _Language-files: Language files """""""""""""" The language files are in directory EXT:sr\_email\_subscribe/Resources/Private/Language. See `http://wiki.typo3.org/index.php/Translations `_ and `http://translation.typo3.org/ `_ . For questions you can ask news://netfielders.de:119/typo3.translation.general (news reader). Send improvements to translations and text improvements to the translator of your language. Use the Language module to install the available translations. .. _Adapting-labels: Adapting labels """"""""""""""" You may adapt labels to your needs and languages. Any label may be overridden by inserting the appropriate assignment in your TS template setup: :: plugin.tx_sremailsubscribe._LOCAL_LANG.languageCode.labelName = overridingValue You can find the name of the label you want to modify (or translate) by inspecting the extension file EXT:sr\_email\_subscribe/Resources/Private/Language/locallang.xlf. .. _Overriding-labels-specified-in-TCA: Overriding labels specified in TCA """""""""""""""""""""""""""""""""" You may also override by the same method labels from other files when they are referenced by the TCA definition of a field (see the tutorial section on Adding fields to the subscription form). This is done as follows: :: plugin.tx_sremailsubscribe._LOCAL_LANG.languageCode.tableName.fieldName = overridingValue .. _Switching-salutation-mode: Switching salutation mode """"""""""""""""""""""""" You may also switch the salutation mode used in the labels when this is relevant for the language being used and when the labels are either available in the pi1/locallang.xml file or provided by TypoScript setup. See the TypoScript Reference section. .. _Labels-with-variables: Labels with variables """"""""""""""""""""" Some labels in pi1/locallang.xml have names starting with 'v\_'. In those labels, the following variables may be used: %1$s : the title of the pid containing the subscriber records created by the extension; - %2$s : *unused* - %3$s : the name of the subscriber, combining the first, middle and last names; - %4$s : the email address of the subscriber; .. _Adding-extra-labels: Adding extra labels """"""""""""""""""" Property extraLabels in TS setup may specify a list of extra labels that may be used in the HTML template. The values of these labels are specified in TS setup with the same type of assignment as when overriding localized labels: :: plugin.tx_sremailsubscribe._LOCAL_LANG.languageCode.extraLabelName = extraLabelValue .. _Configuration: Configuration ------------- .. _Configuration-steps: Configuration steps ^^^^^^^^^^^^^^^^^^^ These are the steps to configuring the Email Address Subscription plugin: Install the extension using the Extension Manager. If not yet installed, you will be requested to install extensions Front End User Registration (sr\_feuser\_register) 4+, Address List (tt\_address) 3+ and Static Info Tables (static\_info\_tables) 6.3.6+. Review the configuration settings of extension Address List (tt\_address). Add the following static template to your TypoScript template: **Email Address Subscription Setup** . Create a folder page that will contain the subscriber records. Set the TS template constant **pid** to the page id of this folder. Create a page; insert the Email Address Subscription plugin, setting the Display mode to Create, and setting the Record Storage Pageto the folder that will contain the subscriber records. Set the TS template constant **registerPID** , **confirmPID** and **editPID** to the page id of this page. If you wish to have confirmation and/or edition on different pages, you may also create a second page, insert the Email Address Subscription plugin, setting the Display mode to General and setting the Record Storage Page to the folder that will contain the subscriber records, and set the TS template constants **confirmPID** and **editPID** to the page id of this page. Decide which fields you want to be included on the subscription form and, among those, which ones you want to be required in order to subscribe; using the Constant Editor TS template tool to set TS constants **formFields** and **requiredFields** . Using the Constant Editor TS template tool, review the values of all the TS constants of the plugin. If you do not use the Constant Editor to configure the plugin, please note the possible forms of the constants assignments in the constants section of your TS template: **plugin.tx\_sremailsubscribe.** ***property*** **=** ***value*** and **plugin.tx\_sremailsubscribe\_pi1.** ***property*** **=** ***value*** . When the plugin is operating correctly, adapt the HTML template, the style sheets and the labels to the needs of your web site. .. _Upgrading-from-version-4-to-version-5: Upgrading from version 4+ to version 5+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When you upgrade from version 4+ to version 5+: - With TYPO3 CMS 7 LTS, there is nothing special to do. - With TYPO3 CMS 8 LTS, the image field (and any other user-defined file-referencing field) of the Address (tt\_address) record must be migrated to FAL. - With TYPO3 CMS 8 LTS, the default upload folder is **2:/tx\_sremailsubscribe/** . .. _Upgrading-to-version-4: Upgrading to version 4+ ^^^^^^^^^^^^^^^^^^^^^^^ When you upgrade from an older version to version 4+: - If upgrading from a version older than 2.1 first see: `https://docs.ty po3.org/typo3cms/extensions/sr\_email\_subscribe/2.1.0/ExtEmailAddress Subscription/Configuration/UpgradingToVersion21+/Index.html `_ - Using the Extension Manager, the database must be updated. - The extension and its base extension are completely refactored: all API is modified with NO backwards compatibility. You may need to adapt any custom class that was extending a class provided by this extension. - Localization files are converted and moved as follows: - locallang.xml => Resources/Private/Language/locallang\_db\_layout.xlf - locallang\_db.xml => Resources/Private/Language/locallang\_db.xlf - pi1/locallang.xml => Resources/Private/Language/locallang.xlf - Localization files on the translation server will need to be moved/copied/redirected accordingly. - Uses extbase localization: The TypoScript configuration may need to be changed. In TypoScript setup, plugin.tx\_sremailsubscribe\_pi1.salutation and plugin.tx\_sremailsubscribe\_pi1.\_LOCAL\_LANG should become plugin.tx\_sremailsubscribe .settings.salutation and plugin.sremailsubscribe.\_LOCAL\_LANG - Default styles are removed from default TypoScript setup and moved to an external file. A new static template may be included in order to include the default styles on the frontend page. - Template subpart ###TEMPLATE\_INVALID\_TOKEN### should be added to any custom template file. - Markers ###MAXLENGTH\_name\_of\_field### for the maxlength attribute were added to forms subparts. The value is obtained from the TCA field configuration. Custom templates may be adapted accordingly. - On subpart ###TEMPLATE\_DELETE\_PREVIEW###, the value of the onclick attribute of the doNotSave button was changed to: 'this.form['tx\_sremailsubscribe\_pi1[cmd]'].value='edit'; return true; '. .. _Extension-configuration-variables: Extension configuration variables ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Extension Manager installation dialog allows you to set the following extension configuration variables: - Image upload folder: This is the place where the images are stored. Default is uploads/tx\_sremailsubscribe. - Use image folder: Enable the usage of imageFolder for the upload of images. Default is 0. - Address table: Name of the address table to be used in the backend. Default is tt\_address .. _TypoScript-Constants: TypoScript Constants ^^^^^^^^^^^^^^^^^^^^ .. _Constants-plugin-tx-sremailsubscribe: Constants ( **plugin.tx\_sremailsubscribe)** """""""""""""""""""""""""""""""""""""""""""" Please note that the following properties refer to TS template constants, not TS template setup. If you do not use the Constant Editor to configure the plugin, please note the form of the constants assignments in the constants section of your TS template: **plugin.tx\_sremailsubscribe.** ***property*** **=** ***value*** .. ### BEGIN~OF~TABLE ### .. _formFields: formFields ~~~~~~~~~~ .. container:: table-row Property formFields Data type string Description List of fields to be included on the subscription form. Should be a subset of the columns of the 'tt\_address' table. Note: If Direct Mail (direct\_mail) extension is not installed, fields module\_sys\_dmail\_category and module\_sys\_dmail\_html are ignored (removed from the list). Note: The default HTML template contains markers for the following fields: email, name, first\_name, middle\_name, last\_name, date\_of\_birth, status, address, city, zone, static\_info\_country, zip, phone, fax, language, title, company, www, image, comments, module\_sys\_dmail\_category, module\_sys\_dmail\_html, captcha\_response Note: If field captcha\_reponse is included, a captcha image will be inserted on the subscription creation and on the infomail forms. Default email, first\_name, last\_name, date\_of\_birth, address, city, zone, static\_info\_country, zip, mobile, phone, language, title, company, www, module\_sys\_dmail\_html, module\_sys\_dmail\_category, image, comments, hidden .. _requiredFields: requiredFields ~~~~~~~~~~~~~~ .. container:: table-row Property requiredFields Data type string Description List of fields that must be filled in on the subscription form. Should be a subset of the list specified on the 'formFields' property. Note: Field captcha\_response should not be set as required. Default email, first\_name, last\_name .. _authcodeFields: authcodeFields ~~~~~~~~~~~~~~ .. container:: table-row Property authcodeFields Data type string Description Authentication code fields: the list of fields that are used in the calculation of authentication codes for delete and edit actions. Note: Direct Mail extension uses only uid in its calculations. But the list may also be configured in the configuration of Direct Mail. Default uid .. _codeLength: codeLength ~~~~~~~~~~ .. container:: table-row Property codeLength Data type int Description Length of the authentication codes. Note: Direct Mail extension uses only 8 in its calculations. Default 8 .. ###### END~OF~TABLE ###### See the manual of extension Front End User Registration (sr\_feuser\_register) for the documentation of the other constants. .. _Constants-plugin-tx-sremailsubscribe-pi1: Constants ( **plugin.tx\_sremailsubscribe\_pi1)** """"""""""""""""""""""""""""""""""""""""""""""""" Please note that the following properties refer to TS template constants, not TS template setup. If you do not use the Constant Editor to configure the plugin, please note the form of the constants assignments in the constants section of your TS template: **plugin.tx\_sremailsubscribe\_pi1.** ***property*** **=** ***value*** .. ### BEGIN~OF~TABLE ### .. _file-attachmentFile: file.attachmentFile ~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property file.attachmentFile Data type string Description File name of a file to be attached to the subscription confirmation email. Default EXT:sr\_email\_subscribe/Resources/Public/TextFiles/attachment.txt .. _HTMLMailCSS: HTMLMailCSS ~~~~~~~~~~~ .. container:: table-row Property HTMLMailCSS Data type string Description File name of the HTML emails style sheet. If HTML emails are enabled, this file contains the CSS style sheet to be incorporated in these emails. Default EXT:sr\_email\_subscribe/Resources/Public/StyleSheets/htmlmail.css .. ###### END~OF~TABLE ###### .. _TypoScript-Setup: TypoScript Setup ^^^^^^^^^^^^^^^^ When installing this extension, you should NOT use the following setting: :: config.disableAllHeaderCode = 1 This setting will prevent the inclusion of Javascript essential to the correct behavior of the profile editing features. .. ### BEGIN~OF~TABLE ### .. _extraLabels: extraLabels """"""""""" .. container:: table-row Property extraLabels Data type string Description Comma-separated list of additional labels to use in the HTML template. See section Labels and localization about adding extra labels. Default None .. ###### END~OF~TABLE ###### .. _Sending-invitations: Sending invitations ^^^^^^^^^^^^^^^^^^^ Create a page, limiting access to this page to users who will be authorized to send invitations to subscribe. Insert the Email Address Subscription plugin, setting the Display mode to 'Invite'and setting the Record Storage Pageto the folder that will contain the subscriber records. When a subscription account is created through this page, an invitation message is sent to the email address specified on the subscription account. The invited person may accept or decline the invitation. .. _Using-frames: Using frames ^^^^^^^^^^^^ If the subscription confirmation and editing pages (confirmPID and editPID) are designed to be displayed within frames, then you should add the following lines to your TS template setup: [globalVar = TSFE:id = {$plugin.tx\_sremailsubscribe.confirmPID}, TSFE:id = {$plugin.tx\_sremailsubscribe.editPID} ] config.page.frameReloadIfNotInFrameset = 1 config.linkVars > config.linkVars = L,tx\_sremailsubscribe\_pi1,fD,cmd,rU,aC config.no\_cache = 1 [global] after setting plugin.tx\_sremailsubscribe.confirmPID and plugin.tx\_sremailsubscribe.editPID in your TS template constants. Note that cmd, rU and aC are in the list for compatibility with the Direct mail extension. .. _Reducing-the-length-of-URL-s: Reducing the length of URL's ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You may find that the url's sent in emails to the subscriber are too long and may be broken when using plaintext emails. .. _Using-plain-text-emails-and-notification-email-urlmode: Using plain text emails and notification\_email\_urlmode """""""""""""""""""""""""""""""""""""""""""""""""""""""" If you are using plaintext emails ( **enableHTMLMail** is set to 0), then, in your TS template setup, set config.notification\_email\_urlmode = 76 or config.notification\_email\_urlmode = all . See TSRef for information about this CONFIG setup property. .. _Using-the-short-URL-feature-possibly-with-RealURL: Using the short URL feature, possibly with RealURL """""""""""""""""""""""""""""""""""""""""""""""""" This approach is compatible with both HTML and plain text emails. Simply enable the feature by setting the TS constant **useShortUrls** = 1 in your TS template. You should also review the default value of TS constant **shortUrlLife** and set it to a value that fits your needs. If you are using the RealURL extension, you should add something like the following to your RealURL configuration in the $TYPO3\_CONF\_VARS['EXTCONF']['realurl'] variable of localconf.php: :: 'postVarSets' => array( '_DEFAULT' => array( 'subscribe' => array( array( 'GETvar' => 'tx_sremailsubscribe_pi1[regHash]' ) ) ), .. _Using-Captcha: Using Captcha ^^^^^^^^^^^^^ It is possible to activate the display of a captcha image and a text field, where the user must enter the text displayed on the image. Extension sr\_freecap must have been installed. The captcha\_response field should not be specified as a required field. Set in TS Constants: :: formFields := addToList(captcha_response) or, using the TS Constant Editor, add captcha_response to the list of fields and in TS Setup: :: plugin.tx_sremailsubscribe_pi1 { create.evalValues.captcha_response = freecap ## Adding captcha to the infomail form infomail.fields := addToList(captcha_response) infomail.evalValues.captcha_response = freecap } .. _Silently-not-sending-infomail-to-a-non-subscribed-email-address: Silently not sending infomail to a non-subscribed email address ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The plugin may be configured to **silently** refuse to send an infomail if the email address that was entered in not subscribed. When this is configured, if a non-subscribed email address is entered in the infomail dialogue, the infomail is not sent, but the website visitor in not informed that the email is not subscribed and that the email is therefore not sent. Set in TS Setup: :: plugin.tx_sremailsubscribe_pi1 { email.INFOMAIL_NORECORD = 0 } .. _Tutorial-Adding-custom-fields-to-the-subscription-form: Tutorial: Adding custom fields to the subscription form ------------------------------------------------------- .. _Extend-the-tt-address-table: Extend the tt\_address table ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The simplest way to extend the tt\_address table is to create a small extension that will define the required fields in the database and the TCA. Your small extension will not contain any plugin or other processing. Once your extension is created, install it. This will make the fields you have defined available to all other extensions. .. _Add-the-fields-in-the-HTML-template: Add the fields in the HTML template ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You need to update the HTML template in order to include in the proper subparts the fields you have defined. The subparts of interest are: ###TEMPLATE\_CREATE### ###TEMPLATE\_CREATE\_PREVIEW### ###TEMPLATE\_INVITE### ###TEMPLATE\_INVITE\_PREVIEW### ###TEMPLATE\_EDIT### ###TEMPLATE\_EDIT\_PREVIEW### and perhaps some of the email subparts. Have a look at how the pre-defined fields are included in each of the subparts, and do the same for the fields you are adding. The HTML for a field named *myNewFieldName* in the CREATE, INVITE and EDIT subparts would look like: ::
###REQUIRED_MYNEWFIELDNAME###

###EVAL_ERROR_FIELD_myNewFieldName###

###MISSING_MYNEWFIELDNAME###

In the case of a field of type textarea, check, radio and select, the HTML for the field should rather look like the following: ::
###REQUIRED_MYNEWFIELDNAME###

###EVAL_ERROR_FIELD_myNewFieldName###

###MISSING_MYNEWFIELDNAME###

###TCA_INPUT_myNewFieldName####
In each PREVIEW subpart, you need to add lines like: ::
###LABEL_MYNEWFIELDNAME###
###FIELD_MYNEWFIELDNAME###
or ::
###LABEL_MYNEWFIELDNAME###
######TCA_INPUT_MYNEWFIELDNAME###
.. _Modify-the-TS-template-Constants-and-Setup: Modify the TS template Constants and Setup ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Using the Constant Editor, modify the value of the following constants of plugin tx\_sremailsubscribe: **formFields** : add to the list of fields the names of the fields that you have defined and that you want to be displayed in the front end subscription form; if the field is not in this list the subpart will be deleted; **requiredFields** : add to the list of fields the names of the fields that you have defined and that you want to be treated as required fields; if the field is not in the list OR if the field is in this list and is correctly filled, the subpart will be deleted. You may also specify in the TS template Setup some default values and validation rules to be applied by the extension to the additional fields. If there are no validation rules, you should set: :: plugin.tx_sremailsubscribe_pi1.create.evalValues.myNewFieldName = If your field is a select field and if you wish to enable multiple selection, you should also set: :: plugin.tx_sremailsubscribe_pi1.parseValues.myNewFieldName = multiple .. _Add-the-language-labels-for-the-new-fields: Add the language labels for the new fields ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The language labels for the additional database fields should be added in Step1 above. These will be used by the back end forms. The language labels used by the front end plugin should be added in the TS template setup using the method described in section Localization of this document. For each language of interest to you with *languageCode* , you may need the following statements for each additional field with *myNewFieldName* : the basic field label: :: plugin.tx_sremailsubscribe._LOCAL_LANG.languageCode.f myNewFieldName = myNewFieldLabel the message displayed when the field is required but missing: :: plugin.tx_sremailsubscribe._LOCAL_LANG.languageCode.missing_myNewFieldName = missingRequiredFieldMessage same as previous but for the invitation form: :: plugin.tx_sremailsubscribe._LOCAL_LANG.languageCode.missing_invitation_ myNewFieldName = missingRequiredFieldMessageOnInvitationForm the message displayed when a validation rule *evalRuleName* applicable to the field is not satisfied: :: plugin.tx_sremailsubscribe._LOCAL_LANG.languageCode.evalErrors_evalRuleName_myNewFieldName = errorMessageForEvalRule .. _Change-Log: Change Log ---------- See: `https://forge.typo3.org/projects/extension- sr\_email\_subscribe/repository/revisions/master/changes/ChangeLog `_ 14 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.png .. :border: 0 .. :height: 21 .. :hspace: 9 .. :id: Grafik2 .. :name: Grafik2 .. :width: 87