DEPRECATION WARNING

This documentation is not using the current rendering mechanism and will be deleted by December 31st, 2020. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

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

Extension Key: sr_email_subscribe

Language: en

Keywords: forAdmins, forIntermediates, tt_address, direct_mail

Copyright 2000-2018, Stanislas Rolland, <typo3(arobas)sjbr.ca>

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

Introduction

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

  • 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

  • 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

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

Please see or report bugs on TYPO3 Forge: https://forge.typo3.org/projects/extension- sr_email_subscribe/issues

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

Front End Rendering

HTML Template

The default HTML template provided with the plugin is:

EXT:sr_email_subscribe/Resources/Private/Templates/SubscribeHtmlTemplate.html
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

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

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

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

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

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

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

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 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+

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+

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

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

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*

formFields

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

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

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

Property

codeLength

Data type

int

Description

Length of the authentication codes.

Note: Direct Mail extension uses only 8 in its calculations.

Default

8

See the manual of extension Front End User Registration (sr_feuser_register) for the documentation of the other constants.

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*

file.attachmentFile

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

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

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.

extraLabels

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

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

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

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

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

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

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

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

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

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:

<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
<dt>
        <label for="tx-sremailsubscribe-pi1-myNewFieldName">###LABEL_MYNEWFIELDNAME###</label>
        <span class="tx-sremailsubscribe-pi1-required">###REQUIRED_MYNEWFIELDNAME###</span>
</dt>
<dd>
        <!-- ###SUB_ERROR_FIELD_myNewFieldName### -->
        <p class="tx-sremailsubscribe-pi1-error">###EVAL_ERROR_FIELD_myNewFieldName###</p>
        <!-- ###SUB_ERROR_FIELD_myNewFieldName### -->
        <!-- ###SUB_REQUIRED_FIELD_myNewFieldName### -->
        <p class="tx-sremailsubscribe-pi1-error">###MISSING_MYNEWFIELDNAME###</p>
        <!-- ###SUB_REQUIRED_FIELD_myNewFieldName### -->
        <input id="tx-sremailsubscribe-pi1-myNewFieldName" type="text" size="40" maxlength="50" title="###TOOLTIP_MYNEWFIELDNAME###" name="FE[tt_address][myNewFieldName]" class="tx-sremailsubscribe-pi1-text" />
</dd>
<!-- ###SUB_INCLUDED_FIELD_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:

<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
<dt>
        <label for="tx-sremailsubscribe-pi1-myNewFieldName">###LABEL_MYNEWFIELDNAME###</label>
        <span class="tx-sremailsubscribe-pi1-required">###REQUIRED_MYNEWFIELDNAME###</span>
</dt>
<dd>
        <!-- ###SUB_ERROR_FIELD_myNewFieldName### -->
        <p class="tx-sremailsubscribe-pi1-error">###EVAL_ERROR_FIELD_myNewFieldName###</p>
        <!-- ###SUB_ERROR_FIELD_myNewFieldName### -->
        <!-- ###SUB_REQUIRED_FIELD_myNewFieldName### -->
        <p class="tx-sremailsubscribe-pi1-error">###MISSING_MYNEWFIELDNAME###</p>
        <!-- ###SUB_REQUIRED_FIELD_myNewFieldName### -->
        ###TCA_INPUT_myNewFieldName####
</dd>
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->

In each PREVIEW subpart, you need to add lines like:

<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
<dt>###LABEL_MYNEWFIELDNAME###</dt>
<dd>###FIELD_MYNEWFIELDNAME###</dd>
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->

or

<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->
<dt>###LABEL_MYNEWFIELDNAME###</dt>
<dd>######TCA_INPUT_MYNEWFIELDNAME###</dd>
<!-- ###SUB_INCLUDED_FIELD_myNewFieldName### -->

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

<!--###SUB_INCLUDED_FIELD_ myNewFieldName ###--> 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

<!--###SUB_REQUIRED_FIELD_ myNewFieldName ###--> 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

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