Search code examples
typo3typo3-6.2.xpowermail

Parse Powermail 2.x Fields HTML in Email Output (TYPO3 6.2.x)


In some checkbox fields of a Powermail 2.x form in TYPO3 6.2.x, I have HTML inside the Value of a checkbox, which is needed on the website, but should be "parsed away" in the email to the receiver.

Of the selected value

<span class="kurs-col1">Nr.1</span> <span class="kurs-col2">Kurs 1 </span> <span class="kurs-col3">1.1.2015</span> 

This is the Output I need in the email:

Nr.1 Kurs 1 1.1.2015

I think I did this in Powermail 1.x with the following TypoScript:

label.parse = true
label.allowTags = span,strong

But these settings seem to be gone. How can I do it?


Solution

  • Now I try to edit the mail template ReceiverMail.html.

    I can strip tags from one field successfully:

    <f:format.stripTags>
    {uid1694}
    </f:format.stripTags>
    

    But that doesn't work for {powermail_all} yet.

    I go to Partials/PowermailAll/Mail.html and wrap <f:format.stripTags></f:format.stripTags> around the field's value:

    <tr>
    <td valign="top">
        <b><vh:string.RawAndRemoveXss>{answer.field.title}</vh:string.RawAndRemoveXss></b>
    </td>
    <td valign="top">
        <f:if condition="{vh:Condition.IsArray(val: '{answer.value}')}">
            <f:else>
                <f:format.nl2br><f:format.stripTags>{answer.value}</f:format.stripTags></f:format.nl2br>
            </f:else>
            <f:then>
                <f:for each="{answer.value}" as="subValue" iteration="index">
                    <f:if condition="{subValue}">
                        <f:format.stripTags>{subValue}</f:format.stripTags><f:if condition="{index.isLast}"><f:else>, </f:else></f:if>
                    </f:if>
                </f:for>
            </f:then>
        </f:if>
    </td>
    

    And it works, and a big hooray for fluid and Powermail!