Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

1.4. Installing Direct Mail Module

Mail User Administration

Installing Direct Mail Plugin

There are 2 parts to this plugin:

  1. An administration page where the users subscribe, and

  2. The Direct Mail Module is the engine that generates the mailing. Newsletters are also stored in subfolders of the module. The newsletters are basically a regular page with content and subsequently; a mailing is created based on the newsletter page.

Make sure you have the following extensions installed and active

  • 'Web->Plugin->Direct Mail'

  • 'Address list'

  • 'Direct Mail Subscription'

Mail User Administration

On the 'Mail user administration' page users can subscribe to the newsletter. A subscription generates an "Address" record in the "Direct Mail module". The subscriber is able to maintain his account by email-based authentication.

Creating the Mail User Administration Folder

The administration folder is a regular page with page content.

  1. Create a new page in the directory tree.

  2. Create a new page content like the one in the screen shot below.From Type select 'Insert Plugin'From Plugin select 'DirectMail subscription'

  3. Save the new page content

Administration Typo3 Template

This is how your Mail User Administration Typo3 Template should look.

I went to the Direct Mail Example and copied the template from there.

  1. This ID is the for the 'Direct Mail Module' Folder you are using. You can create a new one in your website or use the one from the example outside your website. They both will work.

  2. The code here needs to be all on one line. I only split it up to make it visible.The template file could also be moved to the fileadmin/media/scripts folder and the link will just have to be changed accordingly here.

  3. There is no need to make any changes to the Setup field

  4. Make sure that there are checkmarks in the Clear Constants and Setup boxes and none in  Rootlevel.

  5. In Include Static there are 2 items: content (default) and plugin.feadmin.dmailsubscrip...

Direct Mail Module

In the 'Direct Mail folder' all the subscribers are stored and the newsletters are stored in subfolders. In the "Direct Mail folder" you'll also find a template which determines the design of the newsletters and furthermore there are "Direct Mail records" which represents a 'direct mail campaign' based on a certain newsletter and bound for a certain selection of subscribers.

Installing the 'Direct Mail Module'

  1. Create a new folder

  2. Go to Edit Header and from the Type drop down menu select 'Sysfolder'.OrCopy the 'Direct Mail Module' folder from the Direct Mail Example and paste it after the 'Mail User Administration' folder you have just previously created.

If you copied the folder you will not have to make any changes to the folder.

If you created a new folder you can follow the information given under 'Module Configuration' and set it up the way you want it or start of with this information in the Tsconfig field  and then make changes later in the 'Module Configuration'.

## CONFIGURATION of the direct mail module:

mod.web_modules.dmail {
  from_name = John Spam Doe
  from_email= john.doe@nothing.test
  organisation = John Does Testsite
  replyto_email =
  replyto_name =

  plainParams = &type=99
  HTMLParams = 

    # UID's of the tt_address records to use for test-sending:
  test_tt_address_uids = 13,14

    # table name of a userdefined table similar to tt_address (same fields) which may be used for distribution also.
  userTable = 
  enablePlain = 1
  enableHTML = 1

  http_username = 
  http_password = 
  sendOptions=3
  categories {
    1 = Food
    2 = Books
    3 = Sport
    4 = Religion
  }
}

mod.web_dmail.test_dmail_group_uids=1,2
mod.web_modules.dmail.categories.0=Food
mod.web_modules.dmail.categories.1=Books
mod.web_modules.dmail.categories.2=Sport
mod.web_modules.dmail.categories.3=Religion
mod.web_modules.dmail.categories.4=
mod.web_modules.dmail.sendOptions=3
mod.web_modules.dmail.long_link_mode=0
mod.web_modules.dmail.quick_mail_encoding=0

Note

Make sure that you have selected Direct Mail from the drop down menu in the 'Contains plugin” section.

Now save your file.

Direct Mail Typo3 Template

This is the Typo3 Template that is associated with the Direct Mail Module.

Constants and Setup fields are empty.

  • Clear: Constants and Setup have checkmarks in the boxes

  • Rootlevel has no checkmark in the box

  • Include Static has template; NEWSLETTER, plugin.alt.plaintext (99) and cSet (default) included

    <!--StartFragment-->

    (if you include CSet (default) you will have problems with the emails)

    <!--EndFragment-->

Editing Direct Mail Module

After testing the Direct Mail Module you end up with a whole bunch of sent mail. How do you gain access to those items to delete them? Simple. Select 'List' in the Typo3 column then click on the  'Direct Mail Module' folder and you will see the screen shot below in your workarea.

Apart from the normal 'Page' and 'Template' sections there are now Address, Direct Mails and Direct Mail Groups sections.

  • AddressHere you see at a glance all the addresses of your subscribers.

  • Direct MailsAll the mailing you have sent are listed here.

  • Direct Mail GroupsAll the Groups you have created are listed here.

Configuring the Newsletter HTML Template

Now the Newsletter HTML Template has to be included and changed to reflect our customization.

Create the Newsletter Page

In Kasper's Direct Mail Example he created a hidden folder that contained the Direct Mail Module and the newsletter page. I just placed the newsletter page above the Direct Mail Module in my tree structure. The newsletter page is a page with an 'Insert Plugin' Type as you can see in the screenshot below

Then create a Typo3 Template to go with the just created page.

Typo3 Template for the Newsletter

This is a screenshot of the customized Typo3 Template for the Newsletter

Customizing the Plugin

To customized the plugin go to Template --> Constants Editor --> Plugin.Feadmin.dmailsubscription (9) and make the changes to suite you.

I only customized the following sections:

Template File

This now points to my newsletter template. The default one is at media/scripts/fe_admin/dmailsubscription.tmpl.

Administration Email

This is an important part, because if you leave it out you will not be notified when people subscribe to your newsletter.

Record PID

I have the Direct Mail Plugin in the template associated with the Newsletter Page and not the Direct Mail Module. ID 475 is the ID of the Direct Mail Module in my site structure.

Customize Newsletter HTML File

The last step is now to make the html template file reflect your categories. The original template file is here: media/scripts/fe_admin/dmailsubscription.tmpl

Note

I prefer to work with copies in case something goes wrong, so either rename the original or create another copy with a new name.

The template file is setup to work just fine, but the categories do not automatically copy themselves into that file. So you will have to manually copy your categories to the file.

This is the category code from the original template:

<b>Select Special Categories:</b><BR>

<table>

<tr>

<td>###GW2B###Food###GW2E###</td>

<td><input type="checkbox" name="FE[tt_address]

[module_sys_dmail_category][0]"></td>

</tr>

<tr>

<td>###GW2B###Books###GW2E###</td>

<td><input type="checkbox" name="FE[tt_address]

[module_sys_dmail_category][1]"></td>

</tr>

<tr>

<td>###GW2B###Sport###GW2E###</td>

<td><input type="checkbox" name="FE[tt_address]

[module_sys_dmail_category][2]"></td>

</tr>

<tr>

<td>###GW2B###Religion###GW2E###</td>

<td><input type="checkbox" name="FE[tt_address]

[module_sys_dmail_category][3]"></td>

</tr>

</table>

To change the 4 original category names, just replace them with your categories.

If you have more than 4 categories, just copy one cell from <tr>....</tr> and make the changes. Replace the name of the category and change the number to reflect the number you have in your TypoScript.