Showing posts with label Direct Mail. Show all posts
Showing posts with label Direct Mail. Show all posts

Wednesday, January 25, 2017

TYPO3 - Adding direct mail fields to femanager

In a project I needed to add the direct mail fields "Activate Newsletter" and "Subscribe to categories" to the TYPO3 femanager (thanks to Alex Kellner for this great extension), so frontend users are able to subscribe to a newsletter and select newsletter categories.

Since femanager is created with Extbase, it is easily extendable and I created a small TYPO3 extension named femanager_dmail_subscribe, that automatically adds "Newsletter subscription", "Newsletter category" and "HTML newsletter" direct mail fields to femanager, so editors can select the direct mail fields a frontend user should be able to edit.

femanager plugin field settings

In order to display direct mail categories in the frontend, it is required to add the sysfolder with the direct mail categories to the femanager record storage page.

femanager plugin record storage page
After installing and configuring the extension as shown above, frontend users can edit the selected fields (see screenshot below)

Frontend user can edit direct mail fields

I uploaded 2 versions of the extension to TER. Version 1.0.0 is compatible with TYPO3 6.2 and femanager 1.5.2 and version 2.0.0 is compatible with TYPO3 7.6 and femanager 2.x



Tuesday, December 9, 2014

TYPO3 6.2 - Still some problems with newsletter image rendering

I've done a lot of TYPO3 4.5 to TYPO3 6.2 migrations the last weeks and struggled with some strange behaviour of TYPO3 6.2 in combination with newsletter pages and the TYPO3 Extensions direct_mail and direct_mail_subscription.

I'm pretty sure, some people might run into the same problems during the usage of TYPO3 6.2 and direct_mail / direct_mail_subscription, so I'll describe how I solved the most common problems in this article.

Update 01.01.2015

The first two problems are solved now and you can use renderMethod = table in TYPO3 6.2 and 7.x directly with css_styled_content.

Newsletter pages not rendering images


In order to display HTML newsletters in various e-mail clients it is recommended to output the page layout in old-school HTML table design. In order to do so, I use the following TypoScript for images.


tt_content.image.20.renderMethod = table

This renders image-output in table design and enables the editor to set alignments for images in newsletters. In TYPO3 6.0 and 6.1 I had some major problems with using css_styled_content with the renderMethod shown above, so I used to include the css_styled_content configuration for TYPO3 v4.7 as described in my former blogpost.

This all worked fine for TYPO3 sites migrated from 6.x to TYPO3 6.2. With TYPO3 sites, created directly with TYPO3 6.2, this did'nt work any more and images were just not rendered. I spent several hours of debugging to find out, that a setting in the LocalConfiguration.php was the cause for this. Sites, that have been migrated from TYPO3 6.x to TYPO3 6.2 had [FE][activateContentAdapter] enabled in the Install tool.

After I enabled the [FE][activateContentAdapter] for the directly created TYPO3 6.2 sites, images were rendered correctly with the css_styled_content (v4.7) configuration.


Anyway, the install tool shows a warning, that setting activateContentAdapter is slow, so this only seems to be a temporary solution.

In my opinion a better solution would be to use css_styled_content which comes with TYPO3 6.2 and deactivate [FE][activateContentAdapter], but at the time of writing, there is a bug (see problem below) preventing me from using that option.

Image rendering buggy using TYPO3 6.2 css styled content and renderMethod = table


When I tried to debug my former problem with images not being rendered in page output, I also tried to use css_styled_content from TYPO3 6.2 directly. This resulted in the images being rendered incorrectly (see screenshots below).

3 TYPO3 Logos in TYPO3 backend - each with an individial label in the image

The output using css_styled_content with renderMethod = table results in the following output.

Resulting image output shows 4 images and only the last image is rendered


This seems to be a problem in TYPO3 6.2 and there is also an issue on Forge for this one. I will try to create created a patch, so both the linked and related issues can be closed.

Newsletter not sent to recipient


The last problem I spent some time with is, that newly subscribed recipients did not receive the sent newsletter. As I only send out HTML newsletters, I used to set the following TypoScript in the configuration for direct_mail_subscription


plugin.feadmin.dmailsubscription {
  create {
    overrideValues.module_sys_dmail_html = 1
  }
}

It seems, that this does not work with the latest versions of direct_mail_subscription, so newly created records in tt_address did not contain the nescecary flag. I tried several other approaches including setting hidden input fields for the field mod_sys_dmail_html to the registration form and setting TCAdefaults, but all approaches did'nt work. At least the issue is known, so a fix for this problem may be available soon.

To work around this issue, I set the default value for the field mod_sys_dmail_html to 1 directly in the database by using the following SQL


ALTER TABLE `tt_address` CHANGE `module_sys_dmail_html` `module_sys_dmail_html` tinyint(3) unsigned NOT NULL DEFAULT '1';

Make sure, that this setting may be reverted, if you use the database analyzer in the install tool and apply the original default value for the field.

Monday, July 15, 2013

Direct Mail with images as table-output in TYPO3 6.x

With TYPO3 6.x, "renderMethod = table" seem to be deprecated and does'nt seem to be fully supported anymore. For sites using Direct Mail, this could be an issue, since one of the best ways to keep HTML newsletters compatible with most of all e-mail-clients is to render the output with tables. Especially when it comes to images in newsletters, it is best to use a table layout to be sure, that the images are positioned as expected.

I had to setup a TYPO3 6.x site with Direct Mail and faced the issue described above. Also images where not displayed in the newsletter, which also seems to be an issue when you use Direct Mail in combination with TYPO3 6.x

To handle those issued the following steps are necessary:

  1. For your newsletter TS template, do not include "CSS Styled Content", but "CSS Styled Content TYPO3 v4.7". This version of CSS Styled Content still includes the table rendering method.
  2. Include config.absRefPrefix = {$plugin.tx_directmail_pi1.siteUrl} in your newsletter TS Setup. This fixes the problem with images not being displayed.
After using the settings decribed above, I could successfully send HTML e-mails using Direct Mail in TYPO3 6.x. The solution has been found using TYPO3 forge, where both issues already have been reported.