Newsletter subscriber management

Classification

fp_newsletter

Version

main

Language

en, de, it, fr

Description

Plugin for newsletter subscription and unsubscription. Can be used for the table tt_address or fe_users. A log is written.

Keywords

newsletter,subscription,unsubscription,verify,gdpr,mail,luxletter

Copyright

2023

Author

Kurt Gusbeth

License

This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml

Rendered

Mon, 19 May 2025 15:01:10 +0000

Documentation

english Version, deutsche Version

The content of this document is related to TYPO3, a GNU/GPL CMS/Framework available from www.typo3.org.

Table of Contents

Introduction

What does it do?

The extension fp_newsletter is designed to provide a newsletter subscription and unsubscription service for the table tt_address or fe_users which can be used by the extension mail or luxletter. Furthermore it is designed to be compatible with the GDPR. A log is written about (every) action in a separate table. Old log entries can be deleted by a scheduler task. Note: there are more TypoScript-settings than FlexForm-settings. But the extension can be used without tt_address/fe_users too. Therefore an admin-email-address can be specified. The admin will then get an email with the subscription data. Google reCaptcha v3 or a mathematical captcha can be enabled too. There is a widget for the dashboard available. Available languages: english, german/deutsch, french/français and italian/italiano. The standard language is german, but english texts are also available.

Attention!

This extension is not designed for multiple newsletter-categories! It is possible to subscribe to more than one category, but it is not possible to unsubscribe only from a specific category (at the unsubscribe-form). The whole user will be deleted at an unsubscription so it is not possible to unsubscribe only from category/newsletter X. But from version 4.1.0 it is possible to edit an newsletter subscription!

Note!

If you use version 6 with TYPO3 11.5, you will see no preview in the backend!

Screenshots

One example view of a frontend page:

Frontend page

Subscription form.

Thanks to ...

Thanks to the fixpunkt für digitales GmbH, Bonn for giving me the possibility to realize this extension and share it with the TYPO3 community.

Users Manual

This extension can be configured via TypoScript and via FlexForms. Users will use the FlexForms. Here you find a screenshot of some FlexForm settings:

Backend view

Default Backend view of the plugin

Several links can be specified for entry pages and redirect pages.

The unsubscribe-link must be specified and there must be an extra page for the unsubscription! Here you see an example configuration:

Sample configuration

Sample configuration of the plugin

Note: in the form the fields email and GDPR are always obligatory/mandatory. All other fields are optional. Take a look at the Configuration chapter of this manual.

Administrator manual

You will not need the extension tt_address and mail or luxletter for this extension, but it is recommended. Users can subscribe to your newsletter, if you use addresses from tt_address with the extension mail or if you use addresses from fe_users with the extension luxletter or mail.

Templates

You will find 4 folders in the Templates-folders: Backend, Widget, Email and Log. Backend and Widget are used only in the backend. In the Log-folder are the form-templates. If a user submits the form, the entries lands in the table tx_fpnewsletter_domain_model_log. Only if a user verifies his email-address, his entry will be copied to the table tt_address.

In the Email-folder you find the templates for the email to use user. Its the email for verifying the email-address. And there are email-templates for the admin: UserToAdmin is sent before verification and SubscribeToAdmin is sent after the email verification. If you want to change the text of the email, copy the templates e.g. to fileadmin and set the new path via TypoScript setup:

plugin.tx_fpnewsletter.view.templateRootPaths.1 = fileadmin/bsdist/theme/tmpl/fp_newsletter/Templates/
Copied!

There is a text and a HTML version for email-templates. There you can use the variable {sys_language_uid} in the email templates. You could use <f:if condition="{sys_language_uid} == 1"> to use more than one language in one template.

You can use this translate keys in the email templates: email.dear-gender-first-and-last-name, email.dear-first-and-last-name, email.dear-first-name, email.dear, email.gender-first-and-last-name, email.first-and-last-name and email.first-name.

Note

By default the gender and name is used in emails too and thereby the values of the first- and lastname field should be highlighted as user input in email templates to prevent potential spam-/phishing emails.

Important

Since version 5.x there is not only one plugin name (pi1). In some cases therefore you need to change the template and add or delete the pi-parameter at a f:link.external. E.g. at the unsubscribe-page without a verify unsubscribe page.

Subscription form on every page

You want to insert a newsletter subscription form to your fluid page template? E.g. in the footer of every page? Then you have 2 possibilities.

First way: insert a static form in your template. This extension can read this variables if you provide the used form elements. Read the chapter "Configuration -> External fields" for more information about this way.

Second way: you can load the plugin via f:cObject typoscriptObjectPath in your page template like this:

<f:cObject typoscriptObjectPath="lib.nlsubscriptionContent" />
Copied!

Therefore you need to define lib.nlsubscriptionContent like this:

lib.nlsubscriptionContent = CONTENT
lib.nlsubscriptionContent {
  table = tt_content
  wrap = |
  select {
    pidInList = 22
    where = colPos = 0
  }
}
Copied!

Replace the 0 and 22 with your used colPos and page-uid at the page with your subscription form. If you use the plugin from fp_newsletter for a subscription form, you should select the cacheable subscription form. In this case you must define a page for the subscription too. The form will have that page as target.

Note: you can not use a mathematical captcha on the cacheable subscription form.

Note: you must remove a non-static form on pages that uses the fp_newsletter plugin. E.g. use this on pages that have a verification or delete plugin:

lib.nlsubscriptionContent >
lib.nlsubscriptionContent = TEXT
lib.nlsubscriptionContent.value =

Copied!

Using other salutations

If you don´t like the salutations in the sent email, you can change the text via TypoScript. See chapter configuration. If you want that it depends on the gender you need to change the Partials/Email/Salutation.html file. Example:

<f:if condition="{gender_id}==1 && {lastname}">
  <f:then>
    <f:translate key="email.dear-mrs-last-name" arguments="{0: lastname}" extensionName="FpNewsletter" languageKey="{language_code}" />
  </f:then>
</f:if>
<f:if condition="{gender_id}==2 && {lastname}">
  <f:then>
    <f:translate key="email.dear-mr-last-name" arguments="{0: lastname}" extensionName="FpNewsletter" languageKey="{language_code}" />
  </f:then>
</f:if>
Copied!

You can now use new TypoScript settings. TypoScript example for the above partial:

plugin.tx_fpnewsletter._LOCAL_LANG.de.email.dear-mr-last-name = Sehr geehrter Herr %s,
plugin.tx_fpnewsletter._LOCAL_LANG.de.email.dear-mrs-last-name = Sehr geehrte Frau %s,

Copied!

Using own categories/groups

From version 8.2.0 you can use own categories or groups in your templates. First set the setting settings.categoryOrGroup to e.g. 1 at the subscription page:

plugin.tx_fpnewsletter.settings.categoryOrGroup = 1
Copied!

Second set the setting settings.categoryOrGroup to "" (empty value) at the verify page:

plugin.tx_fpnewsletter.settings.categoryOrGroup =
Copied!

Third add a list of categories or groups in the Partials/Log/FormFields.html Therefore replace this line:

<f:form.hidden property="categories" value="{settings.categoryOrGroup}" id="fp_categories" />
Copied!

with something like this:

<div class="form-group">
  <label class="form-label" class="form-label">Choose a group:</label>
  <div class="form-check">
      <label for="fp_category_1" class="form-check-label">
          <f:form.radio class="form-check-input radiobox categories" id="fp_category_1" property="categories" value="3" /> Greenhorn
      </label>
  </div>
  <div class="form-check">
      <label for="fp_category_2" class="form-check-label">
          <f:form.radio class="form-check-input radiobox categories" id="fp_category_2" property="categories" value="4" /> Customer
      </label>
  </div>
  <div class="form-check">
      <label for="fp_category_3" class="form-check-label">
          <f:form.radio class="form-check-input radiobox categories" id="fp_category_3" property="categories" value="5" /> Employee
      </label>
  </div>
</div>
Copied!

Now the saved value will be used instead of the value of settings.categoryOrGroup.

Note: on the unsubscribe page, settings.categoryOrGroup needs to be set too to e.g. 1.

Note: this was not tested with the edit form.

Note for the Mail-extension

If you are using the Mail-Extension, you can use tt_address or fe_users. If you are using tt_address, this additional fields will be filled: mail_html, mail_salutation and mail_active. If you use the table fe_users, this additional fields will be set: mail_html, mail_salutation, mail_active and categories from categoryOrGroup. New users will not have a group set!

Note for the Luxletter-extension

If you are using the Luxletter-Extension, you can use only the table fe_users. This additional fields will be filled: user group with categoryOrGroup and if the setting newsletterExtension=luxletter is set: luxletter_language.

Unsubscription via Mail-extension

When you send a newsletter you want to add an unsubscription link to your newsletter. If you are using mail, you can do that this way:

Unsubscribe from the newsletter:
https://www.domain.com/newsletter/unsubscribe.html?email=###USER_email###&authcode=###MAIL_AUTHCODE###
Copied!

Replace the link with the link to your unsubscribe page and put it in the newsletter-template or use it as email-content. ###USER_email### and ###MAIL_AUTHCODE### will be replaced by the mail-extension. The parameters can be changed. It must be set via TypoScript:

plugin.tx_fpnewsletter.settings.parameters.email = email
plugin.tx_fpnewsletter.settings.parameters.authcode = authcode
plugin.tx_fpnewsletter.settings.authCodeFields = gender,name
Copied!

The extension fp_newsletter will read those parameters and use the email as default email-address or it will make a direct unsubscription. Note: copy "Fields ... of authentication codes" from mail to plugin.tx_fpnewsletter.settings.authCodeFields too. Note: at the target page you need to select the plugin "Newsletter: unsubscribe via form" or "Newsletter: unsubscribe via mail-link" from this extension. In the last case, settings.authCodeFields must be set too. Disadvantage: it is not possible to unsubscribe only from a specific newsletter in a folder. The whole tt_address entry will be deleted! Note: this method does not work with test-newsletters!!!

Unsubscription via Luxletter-extension

There is a unsubscribe link in the luxletter template. If you use the Luxletter-plugin at the target page, it is not possible to change the status of a Log entry. Furthermore Luxletter removes only the fe_groups category of a fe_users entry. The user remains present.

An completely other ways uses fp_newsletter, if you use "Newsletter: unsubscribe via luxletter-link" of fp_newsletter. In this case, a fp_newsletter log is created and the subscriber will be removed from fe_users. Disadvantage: it is not possible to unsubscribe only from a specific newsletter in a folder. The whole fe_users entry will be deleted!

Example for an unsubscribe-link:

<f:link.external uri="{luxletter:mail.getUnsubscribeUrl(newsletter:newsletter,user:user,site:site)}" additionalAttributes="{data-luxletter-parselink:'false'}" target="_blank" style="font-family:'FiraSans-Light', 'Helvetica Neue', Arial, sans-serif;">
  Unsubscribe from this newsletter abbestellen
</f:link.external>
Copied!

Set plugin.tx_fpnewsletter.settings.unsubscribeMode = 1 if the unsubscription form should be shown instead of the direct unsubscription.

Captchas

You can use 3 different captchas. 2 of them can be configured via TypoScript settings. See chapter "Configuration". The third method is a custom captcha validator and requires PHP acknowledgment, because you will need a second extension. And maybe a third one, e.g. a "friendly captcha" extension.

This extension provides a validate event. If you want to use this validator, add some lines to the New.html template of this extension:

 <html xmlns:fp="https://typo3.org/ns/YourVendor/YourExtension/ViewHelpers" xmlns:f="https://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
   ...
   <f:form action="create" name="log" pluginName="new" object="{log}">
	<f:render partial="Log/FormFields" arguments="{_all}" />
	<fp:form.friendlyCaptcha name="captcha_solution">
		<div class="frc-captcha" data-sitekey="{settings.site_key}" data-solution-field-name="{name}" data-start="focus"></div>
	</fp:form.friendlyCaptcha>
	<div class="text-right">
		<f:form.submit value="{f:translate(key: 'subscribe', default: 'subscribe')}" class="btn btn-primary" />
	</div>
</f:form>
   ...
 </html>

 Add xmlns:fp="https://typo3.org/ns/YourVendor/YourExtension/ViewHelpers" and replace YourVendor and YourExtension.
 Add <fp:form.friendlyCaptcha name="captcha_solution">...</fp:form.friendlyCaptcha>
 and adapt it to your custom captcha extension. And set the TypoScript settings "site_key".
 Note: the lines about shows you only an example for a "friendly captcha" solution.

 Furthermore you need an event listener in your custom captcha extension. It may look like this::

   use YourVendor\YourExtension\Services\CaptchaService;
   use Fixpunkt\FpNewsletter\Events\ValidateEvent;
   use Psr\Http\Message\ServerRequestInterface;

   class NewsletterValidationListener
   {

       /** @var CaptchaService  */
       protected CaptchaService $captchaService;

       /**
        * @param CaptchaService $captchaService
        */
       public function __construct(CaptchaService $captchaService) {
           $this -> captchaService = $captchaService;
       }

       /**
        * Checks if the captcha was solved correctly.
        * @param ValidateEvent $event
        * @return void
        */
       public function __invoke(ValidateEvent $event) : void {
           /** @var ServerRequestInterface $request */
           $request = $GLOBALS['TYPO3_REQUEST'];

           $pluginName = "tx_fpnewsletter_pi1";

           // see if data was provided
           if(!key_exists($pluginName, $request -> getParsedBody()) || !is_array($request -> getParsedBody()[$pluginName])) {
               $event -> setValid(false);
               return;
           }

           [...]

           // validate solution
           $solution = $request -> getParsedBody()[$pluginName]["captcha_solution"];
           $valid = $this -> captchaService -> validate($solution);
           if(!$valid["verified"]) {
               $event -> setValid(false);
               $event -> setMessage("Captcha not valid");
           }
       }
   }

Copied!

Adding additional fields to tt_address

If you want to add additional fields to tt_address, they must be already present in the log-table (tx_fpnewsletter_domain_model_log) and in the tt_address-table. If they are not present, then you must add the fields to both tables via an own extension in your ext_tables.sql file. Example: you want to add the field "gdpr" to tt_address. This field is already part of the log-table. You need to add it only to the tt_address-table by your own. Then you must specify which additional fields should be copied from the log-table to the tt_address-table via TypoScript:

plugin.tx_fpnewsletter.settings.additionalTtAddressFields = gdpr
Copied!

That's all.

Security-notice to version 3.2.6

If you use older versions, you should know this information about the fixed security issues:

  1. It was possible to unsubscribe all users.
  2. The TypoScript value for plugin.tx_fpnewsletter.settings.doubleOptOut was set to 1 by default. You can set it to 1 too if you want to enable double opt out for the unsubscription.
  3. It was possible to cheat at the mathematical captcha check.
  4. It was possible to get user data at the new- and unsubscribe-action.

Therefore you should update the extension!

Updating to version 6.x

Because the support for the extension direct_mail was removed in version 6.0.0, some TypoScript settings changed the name. Unfortunately there is only a update-script for migrating this fields to the new name for FlexForms. You must adapt your TypoScript settings and HTML-Templates by your own. That means you need to edit your TypoScript-settings and HTML-files (FormFields.html and FormFieldsEdit.html): rename the old names. This settings are affected:

  1. dmUnsubscribeMode was renamed to unsubscribeMode.
  2. module_sys_dmail_html was renamed to html.
  3. module_sys_dmail_category was renamed to categoryOrGroup.

FAQ

  • It does not work correct. What can I do?

    Maybe you need to set the storage PID twice: via plugin and via TypoScript. Note, that you need an own page for the newsletter unsubscription.

  • A link is not working as expected. Whats wrong?

    Since version 5.x there is more than one plugin. Maybe the plugin is not the right one. See chapter "Important" above.

  • The domain is missing in the email. Why?

    TYPO3 9 ignores the parameter absolute="1"? Or you have not added a domain in the backend? Add the domain by your own in that case.

  • What will be the username if I use fe_users?

    The username will be the email-address. The default password is joh316. The category can be set via categoryOrGroup and is mandatory!!!

  • I use fe_users but nothing happens.

    Have you set the setting categoryOrGroup? You must define a category.

  • I use tt_address but not mail and nothing happens.

    Have you set the setting html to -1? For the HTML-option-field direct_mail/mail is required.

  • I get the error 'The action "xyz" is not allowed by this plugin.' Whats wrong?

    Maybe you have 2 fp_newsletter plugins on one page. That don´t work. You find a solution for "Subscription form on every page" further up.

  • I don´t want/need a log entry. Can I avoid that?

    Not at all. You can add a task to your scheduler: select the task Scheduler / Table garbage collection. Select there the table tx_fpnewsletter_domain_model_log and set the days after the entries should be deleted. If the CronJob is running, the task will delete all old log entries.

Configuration/TypoScript Reference

Here you find all configuration (settings) possibilities. Configuration via TypoScript (and FlexForms).

Important: for fp_newsletter-versions < 6 you should look here: https://docs.typo3.org/p/fixpunkt/fp-newsletter/5.2/en-us/Configuration/Index.html

Properties for settings

Property Data type Description Default value
table string tt_address, fe_users, other or empty value supported tt_address
newsletterExtension string luxletter (default for fe_users), mail (default for tt_address) or other empty = luxletter
optionalFields string Optional fields: see below gender,firstname,lastname
optionalFieldsRequired string Optional required* fields: see below  
doubleOptOut boolean Enable double out out unsubscription? 1
disableErrorMsg boolean Disable some error messages (e.g. already/not subscribed)? 0
enableUnsubscribeForm boolean Enable unsubscribe form at the subscribe page?** 0
enableUnsubscribeGdprAsHidden boolean Do not show the gdpr-checkbox at unsubscribe form? 0
enableEditForm boolean Enable edit form at the subscribe page?** 0
subscribeUid integer Page for the subscription 1
subscribeMessageUid integer Optional page for the redirect after subscription  
subscribeVerifyUid integer Page for the subscription-verification  
subscribeVerifyMessageUid integer Optional page for the redirect after subscription-verification  
unsubscribeUid integer Page for the unsubscription 1
unsubscribeMessageUid integer Optional page for the redirect after unsubscription  
unsubscribeVerifyUid integer Page for the unsubscription-verification  
unsubscribeVerifyMessageUid integer Optional page for the redirect after unsubscription-verification***  
resendVerificationUid integer Page, where a user can request the verification-email again  
editUid integer Page, where a user can edit his subscription  
gdprUid integer Page with the GDPR text 1
daysExpire integer The link expires after X days 2
searchPidMode integer Search in folders: 0: only in the 1. folder; 1: in all folders° 0
deleteMode integer 1: deleted flag; 2: delete entry; 3: remove only cat./group; 4: hidden f. 1
languageMode integer 0: uses -1 if L>0; 1: uses the sys_language_uid from pages 0
categoryMode integer 0: allow only categories/groups specified in categoryOrGroup; 1: all 1
categoryOrderBy string category order by: title, sorting or uid title
unsubscribeMode integer 0: direct unsubscription with a link from Luxletter; 1: show a form 0
categoryOrGroup string List of categories/groups (uid) from sys_category or fe_groups°°  
html integer 0: only TEXT; 1: TEXT and HTML; -1: ignore mail-fields in tt_address 1
password string Password for the fe_users table. random creates a random password. random
authCodeFields string Copy "Fields ... of authentication codes" from mail here  
reCAPTCHA_site_key string Website-key for Google reCaptcha v3.  
reCAPTCHA_secret_key string Secret key for Google reCaptcha v3  
mathCAPTCHA integer Show a mathematical captcha? 0: no; 1: with 1 digit; 2: with 2 digits 0
honeypot boolean Enable a honeypot against spam? 0
debug boolean Don´t send email when debug=1 0
checkForRequiredExtensions boolean Check, if required extensions are installed. 0: no; 1: yes. 1
company string Name of your company Ihre Firma
gender.please string Text for gender selection Bitte auswählen
gender.mr string Text for the gender mr Herr
gender.mrs string Text for the gender mrs Frau
parameters.active string Parameter for newsletter subscription in external extension (POST)  
parameters.email string Parameter for the email from external source (GET/POST-parameter)  
email.senderMail string Your email-address beispiel@test.de
email.senderName string Your name Absender-Name
email.subscribeVerifySubject string Subject of the verify email (subscription) Bitte verifizieren ...
email.unsubscribeVerifySubject string Subject of the verify email (unsubscription) Bitte verifizieren ...
email.adminMail string Admin email-address - if not empty: an email goes to an admin too  
email.adminName string Admin name Admin
email.adminSubscribeSubject string Subject of the admin email (subscription) Neue Newsletter-Anmeldung
email.adminUnsubscribeSubject string Subject of the admin email (unsubscription) Neue Newsletter-Abmeldung
email.adminMailBeforeVerification boolean 0: send email to admin after verification; 1: before verification 0
email.subscribedSubject string Subject of the confirmation email (subscription) Bestätigung Newsletter-Anmeldung
email.unsubscribedSubject string Subject of the confirmation email (unsubscription) Bestätigung Newsletter-Abmeldung
email.editSubject string Subject to the edit email Ändern Sie Ihr Newsletter-Abo...
email.enableConfirmationMails boolean Send confirmation email to the user after verification? 0: no; 1: yes 0
email.dontAppendL boolean Append the language UID to a template (when L>0)? 0: yes; 1: no°°° 1
overrideFlexformSettingsIfEmpty string Empty FlexForms should be overwritten by TypoScript all uid settings

Note*: only a check via browser is made for the optional required fields.

Note**: you need an own page for the unsubscription/edit! unsubscribeUid/editUid should be defined therefore.

Note***: this page is used too, if doubleOptOut=0. unsubscribeMessageUid is not used if doubleOptOut=0.

Note°: this works only at the unsubscription.

Note°°: comma separated list. E.g. 1,3. Without space. Required for external extensions!

Note°°°: the default value was changed from 0 to 1 in version 3.0.0 and even when L=0 0 will be added from version 3.0.0 to the email-templates when email.dontAppendL=0.

Property details / examples

Languages

You can overwrite the text for other languages like this (if preferXlfFile=0, else see last line):

[siteLanguage("languageId") == "1"]
plugin.tx_fpnewsletter.settings.company = Your company
plugin.tx_fpnewsletter.settings.gender.please = Please select your gender
plugin.tx_fpnewsletter.settings.gender.mr = Mr.
plugin.tx_fpnewsletter.settings.gender.mrs = Mrs.
plugin.tx_fpnewsletter.settings.email.senderMail = example@test.com
plugin.tx_fpnewsletter.settings.email.senderName = Sender-name
plugin.tx_fpnewsletter.settings.email.subscribeVerifySubject = Please verify your email
plugin.tx_fpnewsletter.settings.email.unsubscribeVerifySubject = Please verify your email
plugin.tx_fpnewsletter.settings.email.adminSubscribeSubject = New newsletter-subscription
plugin.tx_fpnewsletter.settings.email.adminUnsubscribeSubject = New newsletter-unsubscription
plugin.tx_fpnewsletter.settings.email.subscribedSubject = Newsletter-subscription confirmation
plugin.tx_fpnewsletter.settings.email.unsubscribedSubject = Newsletter-unsubscription confirmation
[END]
plugin.tx_fpnewsletter._LOCAL_LANG.default.email.pleaseVerify = Please verify your email-address by clicking here:
Copied!

Note: if you want to overwrite the text for the default language, remove this lines: [siteLanguage("languageId") == "1"] and [END].

If you enable the setting preferXlfFile, then you can overwrite the text (subject and salutation) like this:

plugin.tx_fpnewsletter._LOCAL_LANG.en.email.subscribedSubject = Your newsletter subscription is now confirmed
plugin.tx_fpnewsletter._LOCAL_LANG.de.email.subscribedSubject = Deine Newsletter-Anmeldung ist nun bestätigt
Copied!

Note: the default language of the email-templates is german if settings.email.dontAppendL=0! You find the english version in the files that end with 1.html. You should copy the files and modify the path to the templates via TypoScript. See chapter "Administrator manual". Otherwise set settings.email.dontAppendL=1. Note: till version 3.0.0, the default language is german even when settings.email.dontAppendL=1. From version 3.0.0, the email-templates without a appended number are using translated texts by default.

Deprecation-note: dontAppendL will be removed in version 8.0.0. Even all the templates with the ending 0 and 1.

External fields

You can set a default email-address which was submitted before. E.g. you have a form in the footer and the field-name is nlemail, then set the parameter like this:

plugin.tx_fpnewsletter.settings.parameters.email = nlemail
Copied!

That parameter will be read and the value of that parameter will be used as default email-address.

You can do the subscription via an form in an other extension too. E.g. you have an shop and at the end of the order the user wants to subscribe to the newsletter? Then put this extension under the shop extension an select the action "subscribe via external extension". Furthermore you must specify the POST-parameter, which are used in the other extension like this:

plugin.tx_fpnewsletter.settings.parameters.active = tx_myshop_pi1|newOrder|newsletter
plugin.tx_fpnewsletter.settings.parameters.email = tx_myshop_pi1|newOrder|email
Copied!

Only parameters of this format are possible. If they are there, a forward will be made to the action create.

Note:

If you have set the setting "[FE][cacheHash][enforceValidation] = 1", then you must add the parameter from above here: "[FE][cacheHash][excludedParameters]".

Captchas

You can use 3 different captcha methods. If you want to use the Google reCaptcha v3 you need to provide the website key and the secret key. If you want to use a mathematical captcha, you can use 1 or 2 digits. The maximum value for 2 digits is 19. Example:

plugin.tx_fpnewsletter.settings.mathCAPTCHA = 2
Copied!

You can even use an custom captcha like "Friendly Captcha". Read the chapter "Administrator" for more information.

Optional and required fields

Only email and gdpr are mandatory fields in the model. If you need more mandatory fields, you can make them only via TypoScript and the templates required. There are the following optional fields available: gender, title, firstname, lastname, address, zip, city, region, country, phone, mobile, fax, www, position, company. You can make all this fields required. Here an example to enable some of this fields in the subscription form via TypoScript setup:

plugin.tx_fpnewsletter.settings.optionalFields = gender,title,firstname,lastname,www,position,company
plugin.tx_fpnewsletter.settings.optionalFieldsRequired = firstname,lastname,company
Copied!

Using of categories

The table sys_category contains categories for mail. Use them like this:

plugin.tx_fpnewsletter.settings.categoryOrGroup = 1,3
Copied!

It will make two entires into sys_category_record_mm and it will set categories in tt_address (after the verification).

The categories are as hidden-field in the template. You could add checkboxes and copy the checked values by jQuery to the hidden-field if you need a more flexible solution.

Note: this setting is used for groups of fe_users too! If you use fe_users, here you can set the fe_groups. That works only with the extension Luxletter. If newsletterExtension=mail is set, user groups are ignored. Therefore only categories are used.

Note: if deleteMode=3 is set, only categories set in categoryOrGroup will be removed. And the flag mail_active will be set to 0, if newsletterExtension=mail is set.

Changing the labels

Like in every extension, you can change the labels and other messages via TypoScript. Here 2 examples:

plugin.tx_fpnewsletter._LOCAL_LANG.de.tx_fpnewsletter_domain_model_log.email = Email
plugin.tx_fpnewsletter._LOCAL_LANG.de.tx_fpnewsletter_domain_model_log.gdpr_desc2 = Ich bin damit einverstanden, dass die von mir angegebenen Daten elektronisch erhoben und gespeichert werden.
Copied!

You find the designations in the templates used in f:translate key. Note: _LOCAL_LANG.en. does´t work anymore. You need to use .default instead of .en for english text.

Required extensions

This extensions checks in the new action (subscription form) if required extensions are installed. settings.table can be empty, tt_address or fe_users. When it is tt_address, mail is required too, if you use settings.html or settings.categoryOrGroup. You can disable this check:

plugin.tx_fpnewslettersettings.checkForRequiredExtensions = 0
Copied!

Atention: if you select "other" at "used newsletter extension", then settings.html=-1 will be set, because its not clear, which html-fields other extensions have.

Full working example

Here an full example for luxletter and 2 languages:

plugin.tx_fpnewsletter.view.templateRootPaths.10 = EXT:example/Resources/Private/Ext/fp_newsletter/Templates/
plugin.tx_fpnewsletter.view.partialRootPaths.10 = EXT:example/Resources/Private/Ext/fp_newsletter/Partials/
plugin.tx_fpnewsletter.settings {
    table = fe_users
    optionalFields =
    doubleOptOut = 0
    enableUnsubscribeGdprAsHidden = 1
    honeypot = 1
    preferXlfFile = 1
    gdprUid = 1138
    subscribeUid = 1167
    unsubscribeUid = 1002
    subscribeVerifyUid = 1001
    categoryOrGroup = 19
    company = Ihre Online-Redaktion von „Test“
}
plugin.tx_fpnewsletter._LOCAL_LANG.de {
    subscribe = Absenden
    tx_fpnewsletter_domain_model_log.email = E-Mail-Adresse
    tx_fpnewsletter_domain_model_log.gdpr_desc1 = Ich habe die
    tx_fpnewsletter_domain_model_log.gdpr_link_text = Datenschutzerklärung
    tx_fpnewsletter_domain_model_log.gdpr_desc2 = zur Kenntnis genommen und bin damit einverstanden, dass meine Daten unter Beachtung der gesetzlichen Bestimmungen satzungsgemäß verwendet und automatisiert verarbeitet werden.
    unsubscribe_it = Newsletter abbestellen
    email_send1 = Vielen Dank für Ihr Interesse.<br>Eine Bestätigungs-E-Mail wurde Ihnen zugesandt.
    email_verified = Ihre E-Mail-Adresse wurde erfolgreich aufgenommen.
    email_removed = Sie haben sich erfolgreich von unserem Newsletter abgemeldet.
    email.pleaseVerify = Sie haben sich für unseren Newsletter angemeldet.
    email.pleaseVerify2 = Um die Anmeldung zu bestätigen, klicken Sie bitte auf folgenden Link:
    email.subscribeVerifySubject = Anmeldung zum Newsletter bei www.test.de
}
plugin.tx_fpnewsletter._LOCAL_LANG.default {
    subscribe = Send
    required = required
    tx_fpnewsletter_domain_model_log.email = E-mail address
    tx_fpnewsletter_domain_model_log.gdpr_desc1 = I have noted the
    tx_fpnewsletter_domain_model_log.gdpr_link_text = privacy policy
    tx_fpnewsletter_domain_model_log.gdpr_desc2 = and I agree that my data will be used in accordance with the statutory provisions and processed automatically.
    unsubscribe_it = Unsubscribe newsletter
    email_send1 = Thank you for your interest.<br>A confirmation email has been sent to you.
    email_verified = Your email address has been successfully added.
    email_removed = You have successfully unsubscribed from our newsletter.
    email.pleaseVerify = You've signed up for our newsletter.
    email.pleaseVerify2 = To confirm the registration, please click on the following link:
    email.subscribeVerifySubject = Registration for the newsletter at www.test.com
}
[siteLanguage("languageId") == 1]
    plugin.tx_fpnewsletter.settings.company = Your online editors of “Test”
[END]
Copied!

As you can see, you can even define own variables and use them. (Example from here: unsubscribe_it.)

Known Problems

The domain is missing in the emails when using TYPO3 9? Then you need to add the domain in the site-configuration!

The mode unsubscribeMode=1 works only if unsubscribeUid is set.

There is a TYPO3 bug in some releases where the unsubscribe form does not work. In that case you can try to set the settings.unsubscribeUid via FlexForms. For me that helps.

Since version 5.x there is not only one plugin name (pi1). In some cases therefore you need to change the template and add, modify or delete the pi-parameter at a f:link.external or f:form.

Since version 5.x the email content will not be translated when settings.email.dontAppendL=1 is set.

A bug tracker is available for this project at GitHub.

To-Do list

  • Fix the problems with other languages.

ChangeLog

Version 0.10.0: Important change: plugin.tx_fpnewsletter_pi1 renamed to plugin.tx_fpnewsletter, because otherwise empty TS-values overwrite given FlexForm-values. New action: subscribeExt for newsletter subscription via other extensions. Bugfix: partial-path.

Version 0.10.2: Links in the email-templates changed. Bugfix: text-email was missing.

Version 0.11.0: Links in the email-templates works now with TYPO3 8 too. Empty FlexForms will now be overwritten by TypoScript.

Version 0.12.0: now double opt out possible. More FlexForms.

Version 0.13.0: italian translation added. First version for TYPO3 9 (runs only if typo3db_legacy is installed).

Version 0.14.0: composer-file added. Email to an admin now possible. One bug fixed: email-check.

Version 0.15.0: gender divers added. Switch to the QueryBuilder. reCaptcha v3 implemented (optional).

Version 0.16.0: f:format.raw added to text-links. Setting module_sys_dmail_category added. Address-object in verify-actions now available. TS optionalFieldsRequired added. required-attribute added.

Version 0.17.0: new TypoScript setting: email.adminMailBeforeVerification Email to admin now before or after verification. Default status changed! Email to admin only in one language. Very last $GLOBALS['TYPO3_DB'] replaced.

Version 0.18.0: optional mathematical captcha added. Set sys_language_uid=-1 if l>0. The categories are stored now in the log-entry too. More optional fields: address, zip, city, region, country, phone, mobile, fax, www, position, company.

Version 1.0.0: possibility added, to delete old log-entries via a task. Important change: redirect to the new- or unsubscribe-action on email-format- or captcha-errors. Bugfix: you can use now reCAPTCHA and mathCAPTCHA together.

Version 1.0.4: Bugfix: subscription via external form.

Version 1.1.0: possibility added, to activate a honeypot. Bugfix: prevent error on unsubscribe when a captcha is enabled.

Version 1.2.0: deprecated methods replaced.

Version 2.0.0: with the new setting languageMode you can define the language of the entries. There is now a new behavior when L>0. Furthermore the setting email.dontAppendL is new. Confirmation emails can now be send by enabling them with the setting email.enableConfirmationMails. The translate-viewhelper can now be used in the email-templates. Name and salutation can be used now in the email-templates. More FlexForms.

Version 2.1.0: setting searchPidMode and disableErrorMsg added. extension-key added to composer.json.

Version 2.2.1: more variables/translate keys for emails added. See chapter Administration. Now for TYPO3 10 and 11.

Version 2.3.2: a widget for the dashboard added. The extension dashboard is required in TYPO3 11. Setting checkForRequiredExtensions added (does not work for dashboard in TYPO3 11). The table fe_users can now be used too. Form with button added to the verification emails. no-cache parameter removed.

Version 2.4.0: Setting dmUnsubscribeMode added. Flexform for "unsubscribe via link" needs to be saved again. The extension dashboard is no longer required in TYPO3 11. New action: resend verification email. French added (thanks to lucmuller). StopActionException on create when no parameter is there.

Version 3.0.0: breaking change: default value of email.dontAppendL changed from 0 to 1. The email-templates without a number as ending uses now translated texts. If email.dontAppendL=0 even 0 will now be added to the template name. French emails now possible (thanks to lucmuller). Bugfix: form replaced with a normal button in the emails.

Version 3.1.0: salutation in emails moved to a partial. Gender divers will now be ignored in the salutation in emails. The name is now available in the email to the admin on unsubscription. A second dashboard widget added: status diagram. Bugfix: retoken column was too small.

Version 3.2.0: module_sys_dmail_category now in FlexForms too. Important: Layout optimized for Bootstrap 4. IDs in unsubscribe form changed. Backend: preview added.

Version 3.2.5:

  • Switch from cURL to RequestFactory.
  • Bugfix: no categories added in tt_address.

Version 3.2.6:

  • PHP email validation added.
  • Security fix: default password for fe_users set to a random password.
  • Security fix: mathematical captcha check enhanced (it was possible to cheat).
  • Security fix: settings.doubleOptOut set from 0 to 1. You can set it to 0 if you don´t want a double opt out subscription.
  • Security fix: additional check added to the delete-action (it was possible to unsubscribe all users).
  • Security fix: Information Disclosure in the new- and unsubscribe-action.

Version 4.0.0/1:

  • Breaking: default TypoScript values for sys_language_uid 1 removed!
  • New actions: unsubscribe from Luxletter and cacheable form for subscription.
  • New task: import newsletter-subscribers from tt_address to fe_users.
  • Setting preferXlfFile added. If 1, genders and email subjects will come from the xlf file instead of the settings.

Version 4.0.3:

  • Compatibility to direct_mail 11 added.
  • Bugfix: PHP 8 and delete-action.

Version 4.1.0:

  • Edit/update-action added.
  • New TypoScript settings: enableEditForm, editUid, categoryMode, categoryOrderBy and editSubject.

Version 4.1.1:

  • Bugfix for translated text when using preferXlfFile=1.

Version 5.0:

  • Refactored for TYPO3 12 LTS.
  • Breaking: the email-templates and -partials must be changed! Add extensionName="FpNewsletter" to every f:translate.
  • Breaking: in template-forms the argument pluginName must be specified! You find them in the templates of this extension.
  • Breaking: all plugins must be changed via an update-script (in the install-tool)!

Version 5.1:

  • Custom validator added which can be used for other captcha solutions.
  • Bugfix for TYPO3 12.

Version 5.2:

  • Automatically set the correct PluginName in templates.
  • PHP-Bugfix.

Version 6.0.0:

  • Breaking: support for direct_mail removed. Instead, support for the extension "mail" added.
  • Breaking: TypoScript settings dmUnsubscribeMode, module_sys_dmail_html, module_sys_dmail_category renamed to unsubscribeMode, html, categoryOrGroup. See chapter Administrator / Updating to version 6.x.

Version 6.1.0:

  • Compatibility to TYPO3 11.5 added again.
  • Bugfix: language added to the links in the email.

Version 6.2.0:

  • fe_users can now be used with the extension luxletter or mail.
  • deleteMode 3 added: delete only categories (Mail) or user-group (Luxletter).
  • New setting: newsletterExtension (mail or luxletter).

Version 6.3.0:

  • New action: direct unsubscribe via Mail-link and new setting: authCodeFields.

Version 6.3.1:

  • Bugfix: Luxletter is now the default newsletter-extension - to prevent a PHP warning.

Version 6.3.2:

  • Bugfix: reCAPTCHA fixed.

Version 6.4.0:

  • Additional fields can now be copied from the log-entry to the tt_address-table. Setting additionalTtAddressFields added.

Version 7.0.0/1:

  • Refactoring with the rector tool.
  • Adding of the language code to the email text.
  • TypoScript-files have now the ending .typoscript.
  • setting dontAppendL is now deprecated.
  • Bugfix: search in all folders now for mail-unsubscription and edit too.

Version 7.0.3:

  • Bugfix: backend preview.
  • Bugfix: Plugin-Updater.

Version 7.0.4:

  • Unnecessary sql-fields removed.

Version 7.0.5:

  • deleteMode 4 (set hidden/disable flag) added.

Version 7.1.0:

  • SwitchableControllerActionsPluginUpdater (update script for TYPO3 12) removed. Use older versions if you still need it.
  • FlexformPluginUpdater (update script for FlexForms) removed. Use older versions if you still need it.

Version 8.0.0:

  • First version for TYPO3 13.
  • Breaking: setting dontAppendL removed: templates with language-id at the end removed.
  • Breaking: setup.ts and constants.ts removed. The .typoscript files are still there.

Version 8.0.1:

  • New Flexform settings: newsletterExtension and table. "other" sets html to -1.
  • Second widget fixed. Backend preview fixed again. Import task fixed for TYPO3 13.

Version 8.0.4:

  • Edit-plugin changed: step 1 is now the default one.
  • Bugfix: unsubscription with captcha is enabled + deletion from Luxletter.

Version 8.0.5:

  • Bugfix: email to admin.

Version 8.1.0:

  • More fields/information added to the log-entry.

Version 8.1.1:

  • Bugfix: update Log even no mail is sent.

Version 8.2.0:

  • Always save settings.categoryOrGroup in the log-entry.
  • Take the categories or groups from the log-entry when settings.categoryOrGroup is empty.

Version 9.0.0:

  • Breaking: PlugIns changed from list_type to CType. You need to execute the Upgrade Wizard to change your PlugIns.
  • Deprecation fixes for PHP 8.4 and TYPO3 13.