Friday, September 21, 2007

Typo 3 Direct Mail Subscription Templates and Getting them Damn Categories to work.

[Listening to: Amen - Astral Projection - Amen (6:02)]

After spending about a day and a half searching the internet for information on how to get category's to work in Typo3's Direct Mail module, I've finally worked it out.

This applies to Typo3 installations with Direct Mail 2.0.0 or higher and with Direct Mail Subscription 1.1.0

Categories are now stored in a database, rather than how they were previously. The categories themselves are still defined in the old way, and in my case I've got them in a system folder (the id is 54) which will help in deciephering all of the code that's coming up.

On backend pages where you want the categories list to appear you will need to put this in the Page TS Config window (you can find this by going to the Edit Page Properties on the page required.


TCEFORM.tt_content.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 54
TCEFORM.tt_address.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 54
TCEFORM.fe_users.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 54
TCEFORM.sys_dmail_group.select_categories.PAGE_TSCONFIG_IDLIST = 54

TCEFORM.tt_content.module_sys_dmail_category.disabled = 0
TCEFORM.tt_address.module_sys_dmail_category.disabled = 0
TCEFORM.fe_users.module_sys_dmail_category.disabled = 0
TCEFORM.sys_dmail_group.select_categories.disabled = 0


You will also need the line

config.insertDmailerBoundaries = 1

In the Direct Mail Folder, but in the TS Setup property. Installing the static template "Direct Mail Content Boundaries" though, should do this automatically for you.

I've got a bunch of other stuff in mine as well, that's working, so if you have this in, and it doesn't work, let me know, and I'll post the full stuff that's in mine.

For frontend pages where you want the subscriber information I've got this in my Page TS Config.

TCEFORM.tt_content.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 54
TCEFORM.tt_address.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 54
TCEFORM.fe_users.module_sys_dmail_category.PAGE_TSCONFIG_IDLIST = 54
TCEFORM.sys_dmail_group.select_categories.PAGE_TSCONFIG_IDLIST = 54

plugin.feadmin.dmailsubscription.cObjects.CATLIST.pid = 54


I'm not sure if you need the first 4 lines, but the last one is important. It tells the page where to find the categories.

You need to get rid of whatever was in the TS Config box before, because it stops the new one from working properly.

You need to set a template (or at least a template extension) for this page that includes the Direct Mail Content Boundaries Static Template.

You will also need a new tmpl file. The old one simply won't work with the new categories. It will display on the page like it used to, and it will appear to work, but the front page categories won't line up with the new back end categories, and that's kinda the whole point.

To fix it, you will need to add in

[BR]

###CE_CATLIST###

[BR]

(replacing the [ and ] with the angled equivalents.

This will need to go in place of the existing category list (ie the bit that looked a bit like)


[br]
[b]Select Special Categories:[/b][BR]
[table]
[tr]
[td]###GW2B###Corporate###GW2E###[/td][td][input type="checkbox" name="FE[tt_address][module_sys_dmail_category][0]"][/td]
[/tr]
[tr]
[td]###GW2B###Technical###GW2E###[/td][td][input type="checkbox" name="FE[tt_address][module_sys_dmail_category][1]"][/td]

[/tr]
[tr]
[td]###GW2B###Announcements###GW2E###[/td][td][input type="checkbox" name="FE[tt_address][module_sys_dmail_category][2]"][/td]
[/tr]
[/table]

[BR]


There is a new template file included with the latest installations, that you can download from the Typo3 repository (go to http://typo3.org/extensions/repository/list/direct_mail_subscription//info/ext_typoscript_setup.txt/ and download the .tmpl file.)

Note that there is still an error in this new file, and that you'll need to edit this file to fix the Edit Profile links. It's still configured for the old module, not the new one. The simplest way is to search for "Edit profile" and put in the ###CE_CATLIST### entry instead of the Special Categories table.\

You'll probably want to edit the email templates near the bottom of this file as well, so that it is more suited your site (ie change the email subject and contents.)

Once you've made the changes you will need to upload the .tmpl file. This is done on the template page for the page where you want it (or wherever you have the direct mail subscription template setup). Browse and upload.

To change the email address and name that the email is sent from go to the template extension and set the constants in the Direct Mail Subscription section.

The Direct Mail Tutorial is still the easiest way to get this incredibly powerful mailing list running, though you'll need the information above for setting the categories, rather than the tutorial file. The manual is useful for the backend stuff, but tells you nothing about the frontend subscription.

The next thing to do is to tie all of this in with the tt_news plugin, but I might leave that for another day.

Hope this is helpful, and I hope this finds it's way sufficiently up the google list for it to be genuinely useful. If you have any comments, corrections, or questions, please add a comment.

Labels: ,


Comments:
A short addendum to this, because it looks like lots of people are finding this page to help configure directmail.

There is a bug whereby blank newsletters will be generated with the stock directmail/typo3 installation on the latest php installation.

The workaround for this is to clear the cache (using the buttons at the bottom of the left menu in the backend) between each of the steps in creating a direct mail mailout.

I think the cache needs to be cleared immediately before you create the newsletter, or it won't work.

This is documented in the bugs section of the typo3 website and will hopefully be fixed at some stage. I think that there is a fix documented there, but it's a low priority for us at the moment.
 
I notice that there are a lot of Germans visiting this page to sort out this problem.

I'm happy to also host a German language version of this page if someone would like to do the translation.

Please post a comment if you can help.
 
Thank you for this article. It really helped me much!
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?