mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
FEATURE: added ability to send emails to email fields as well as dropdowns
This commit is contained in:
parent
f20a6f2c31
commit
8b84f9caa9
@ -589,12 +589,17 @@ class UserDefinedForm_EmailRecipient extends DataObject {
|
|||||||
|
|
||||||
// if they have email fields then we could send from it
|
// if they have email fields then we could send from it
|
||||||
if($validEmailFields) {
|
if($validEmailFields) {
|
||||||
$validEmailFields = $validEmailFields->toDropdownMap('ID', 'Title');
|
$fields->insertAfter(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASFROM', '.. or Select a Form Field to use as the From Address'), $validEmailFields->toDropdownMap('ID', 'Title'), '', null,""), 'EmailFrom');
|
||||||
$fields->insertAfter(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASFROM', '.. or Select a Form Field to use as the From Address'),$validEmailFields, '', null,""), 'EmailFrom');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if they have multiple options
|
// if they have multiple options
|
||||||
if($multiOptionFields) {
|
if($multiOptionFields || $validEmailFields) {
|
||||||
|
if($multiOptionFields && $validEmailFields) {
|
||||||
|
$multiOptionFields->merge($validEmailFields);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$multiOptionFields = $validEmailFields;
|
||||||
|
}
|
||||||
$multiOptionFields = $multiOptionFields->toDropdownMap('ID', 'Title');
|
$multiOptionFields = $multiOptionFields->toDropdownMap('ID', 'Title');
|
||||||
$fields->insertAfter(new DropdownField('SendEmailToFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASTO', '.. or Select a Field to use as the To Address'), $multiOptionFields, '', null, ""), 'EmailAddress');
|
$fields->insertAfter(new DropdownField('SendEmailToFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASTO', '.. or Select a Field to use as the To Address'), $multiOptionFields, '', null, ""), 'EmailAddress');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user