1
votes

In Powermail it is possible to send a confirmation e-mail to a filled in e-mail address. When a frontend user is logged in this field can be prefilled with that user's e-mail address. However we don't want to show the field with the e-mail address. If we change the field to a hidden field it is no longer possible to set the field as the sender e-mail address.

So the question is, is it possible to send a confirmation e-mail in powermail to the logged in frontend user's e-mail address without showing that e-mail address in the form?

For this site we use TYPO3 7.6 and Powermail 4.4.0.

1

1 Answers

0
votes

Regardless on the visibility of the logged user email address you can implement a TypoScript with cObject CONTENT to return an email address by querying against the fe_users database with user id and then override the receiver email configuration setting.

The following code illustrates how to set a different email address for the receiver by getting it from fe_users.email by a certain fe_users.uid (POST param):

lib.receiver = CONTENT
lib.receiver {
    table = fe_users
    select {

        pidInList = 33

        where {
            # UID of the fe_users record is given in field with marker {receiver}
            data = GP:tx_powermail_pi1|field|receiver

            wrap = uid=|
            intval = 1
        }
    }
    renderObj = TEXT
    renderObj {
            field = email
    }
}

plugin.tx_powermail.settings.setup.receiver.predefinedReceiver.receivers1.email < lib.receiver

The above lib.receiver can be used with predefined receivers or directly via cObjectViewHelper in the receiver field in FlexForm like: {f:cObject(typoscriptObjectPath:’lib.receiver’)}