Project

General

Profile

Actions

Feature #76857

closed

EXT:form Dynamic Recipients Concept

Added by Matthias Philipp almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Won't have this time
Category:
Form Framework
Target version:
-
Start date:
2016-06-28
Due date:
% Done:

100%

Estimated time:
1.00 h
PHP Version:
Tags:
Complexity:
easy
Sprint Focus:
On Location Sprint

Description

The possibility to define a dynamic recipient for a contact form has been discussed in the past, and the 1st approach of defining this like it is possible for the sender (senderEmailField) leads to the problem that the form can be abused to send emails to anybody.
However, a usual requirement is that there are predefined recipients for departments, like sales, support, payments etc. or a selection of products which are accociated with the product managers.

My suggestion is to handle it like that:
The form contains a dropdown or radio buttons where the user can select between “Sales”, “Support” and “Payments” in our example, which define the values 1, 2 and 3.
In the form definition this fieldname is set as a keyfield, and the email addresses are defined as an array. So there’s no chance another email address can be entered by the website user.
Example code for the Combobox:

10 = SELECT
10 {
    class = form-control
    name = recipientkey
    required = required
    size = 1
    label {
        value = Recipient
    }
    10 = OPTION
    10 {
        text = Sales Department
        selected = selected
        value = 1
    }
    20 = OPTION
    20 {
        text = Support Team
        value = 2
    }
    30 = OPTION
    30 {
        text = Payments related
        value = 3
    }
}

Example code for the post processor part:

1 = mail
1 {
    recipientEmailKeyField = recipientkey
    recipientEmail {
        1 = sales@typo3.org
        2 = support@typo3.org
        3 = typo3@paymentprovider.org
    }
}

I already implemented this in a project here and would like to add this feature after a short discussion.

Actions

Also available in: Atom PDF