Overview¶
- Shows a small subscription box where users can subscribe to dmail categories.
- If no fe_user exists, a hidden tt_address record will be created. Otherwise dmail categories of fe_user gets updatet after step 3
- Send a confirmation mail. The user has to confirm/decline his subscription. (tt_address record will be "visible", fe_user record gets update in DB)
- Unsubscribe via link in the newsletter
- Works with Typo3 4.5 and 4.6
Specials¶
- Whenever a fe_user is created by sr_feuserregister or manually in Backend, the extension will check if a tt_address with the same email address already exists. If so, it will delete the tt_address entry (adjustable by TS) ... this way you will have only ONE record per user and no duplicated Newsletter recipients!
- Compatible with commerce address management
- Extbase/Fluid flexibility
Tutorial¶
- Install the Extension via EM, check if settings in EM are ok for you
- add "sni_newsletter_subscription" to "Include static TS (from extensions)" in your TS-Template
- Create a SysFolder (X) where you want to store the subscriptions
- Go to EM and set deleteDuplicateAddressPid to X (the newly created page)
- In your TS-Setup add this;
plugin.tx_sninewslettersubscription { persistence.classes.Tx_SniNewsletterSubscription_Domain_Model_TtAddress.newRecordStoragePid = X persistence.storagePid = X settings { # Mail settings for confirmation mail; siteName = fromMail = fromName = # pid of dmail categories module_sys_dmail_category_PIDLIST = } } - If you want to adjust HTML/EMAIL Templates copy the folder PATH/TO/YOUR/INSTALLATION/typo3conf/ext/sni_newsletter_subscription/Resources/Private/Templates to e.g. fileadmin/templates/newsletterSubscription and add to TS-Setup:
plugin.tx_sninewslettersubscription.view.templateRootPath = fileadmin/templates/newsletterSubscription/
... now you can edit the templates ... - insert the registration plugin (via create new content element or directly via TS -- see FAQ below) on any page you like.
- Note: you need at least 1 direct_mail category otherwise users can not confirm their subscription!
- If you want you can put an "unsubscribe link" in the newsletter template (see FAQ)
FAQ¶
- How to insert the plugin via TS?
This is extbase specific. You can do it like this;page.10.subparts.NEWSLETTERBOX = USER page.10.subparts.NEWSLETTERBOX { userFunc = tx_extbase_core_bootstrap->run extensionName = SniNewsletterSubscription pluginName = Subscr }
(see [[http://forge.typo3.org/projects/typo3v4-mvc/wiki/Dispatcher_rework]]
- What if i don't want to use dmail_categories?
You can do this, but nevertheless you have to create at least one dmail_category. Then you can hide the category by editing the template file Subscr/New.html. Delete in that file the part which generates the category checkboxes. Instead of the checkbox part add this;... <f:form.hidden name="moduleSysDmailCategory[UidOfCategory]" value="UidOfCategory" /> ...
Of course you have to substitue UidOfCategory with the real uid of the category.
- Can user unsubscribe the newsletter?
Yes they can, via a link in the newsletter mail. The link has to point to a page where the Newsletter Subscription plugin is available and it must contain some special parameters. You could create the link via TS;NL = PAGE ... NL.marks.UNSUBSCRIBE = TEXT NL.marks.UNSUBSCRIBE { wrap = <a href="/index.php?id=14&w=d&t=###SYS_TABLE_NAME###&u=###USER_uid###&a=###SYS_AUTHCODE###">|</a> value = Unsubscribe from our newsletter }
Of course you have to insert this marker then in your newsletter (direct_mail) template file
Note 1: in this example we assume that the Newsletter Subscription plugin is installed on page with uid:14!
Note 2: mod.web_modules.dmail.authcode_fieldList has to be "uid" (default setting)