TYPO3 8.7.11中direct_mail无法生成纯文本邮件问题求助
Hey there, let's tackle that plain text mail issue you're facing with TYPO3 8.7.11, Fluid Styled Content, and Direct Mail 5.2.2. Since your HTML template works fine but the plain text version only shows the default placeholder, here are targeted steps to resolve this:
1. Double-Check Static Template Setup
You mentioned loading the two required static templates, but let's verify the details:
- Make sure both
Direct Mail content boundariesandDirect Mail plain textare loaded in your root site template (not a sub-template, as sub-templates might not inherit the config correctly). - Head to the Template module, edit your root template's Constant Editor, navigate to the
Direct Mailcategory, and confirm theplaintext_templateconstant points to the correct path:EXT:direct_mail/Resources/Private/Templates/tx_directmail_pi1_plaintext.tmpl. If you're using a custom template later, update this path accordingly.
2. Ensure Fluid Styled Content Compatibility
Direct Mail 5.2.2 needs to properly parse Fluid Styled Content elements for plain text output:
- Test with a basic content element first (like a standard "Text" element) to rule out custom content types causing issues. If the plain text renders correctly for this, your custom content elements might need adjustments for plain text extraction.
- Avoid overriding Direct Mail's core content parsing logic in your custom HTML Fluid templates. If you've modified view helpers or content rendering hooks, they might interfere with plain text generation.
3. Customize the Plain Text Template Explicitly
Sometimes the default template's content tags don't trigger correctly. Try creating a custom plain text template to force content rendering:
- Copy the default
tx_directmail_pi1_plaintext.tmplto your site extension'sResources/Private/Templates/folder (name it something likeCustomPlaintext.tmpl). - Edit the template to include explicit placeholder tags that Direct Mail recognizes:
###TEXT### --- Unsubscribe: ###UNSUBSCRIBE_LINK###
The ###TEXT### tag will pull in the plaintext version of your mail content, while ###UNSUBSCRIBE_LINK### adds the mandatory unsubscribe link.
3. Update the plaintext_template constant in your root template to point to this new file, e.g., EXT:your_site_extension/Resources/Private/Templates/CustomPlaintext.tmpl.
4. Verify Direct Mail Plugin Configuration
Check the plugin settings on your Direct Mail page content element:
- Confirm both Text and HTML are selected under "Mail Format".
- Under the "Content" tab, make sure you've selected a valid content source (either "Select from pages" or "Manual content input") and that the source has actual content.
5. Clear All TYPO3 Caches
Don't skip this! Stale configuration or page caches often cause template issues. Clear the full TYPO3 cache (including configuration cache, page cache, and fluid template cache) via the "Flush all caches" button in the backend toolbar.
If none of these steps work, check the TYPO3 system logs (under the "System" module > "Logs") for errors like missing template files or content parsing failures—these will give you more specific clues to troubleshoot further.
内容的提问来源于stack exchange,提问作者Robert

