mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #853 from dnadesign/fix/reply-to-not-set
Check recipient alternate from/to fields exists
This commit is contained in:
commit
2d310a38f4
@ -326,7 +326,8 @@ JS
|
||||
}
|
||||
|
||||
// check to see if they are a dynamic reply to. eg based on a email field a user selected
|
||||
if ($recipient->SendEmailFromField()) {
|
||||
$emailFrom = $recipient->SendEmailFromField();
|
||||
if ($emailFrom && $emailFrom->exists()) {
|
||||
$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailFromField()->Name);
|
||||
|
||||
if ($submittedFormField && is_string($submittedFormField->Value)) {
|
||||
@ -342,7 +343,8 @@ JS
|
||||
}
|
||||
|
||||
// check to see if they are a dynamic reciever eg based on a dropdown field a user selected
|
||||
if ($recipient->SendEmailToField()) {
|
||||
$emailTo = $recipient->SendEmailToField();
|
||||
if ($emailTo && $emailTo->exists()) {
|
||||
$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailToField()->Name);
|
||||
|
||||
if ($submittedFormField && is_string($submittedFormField->Value)) {
|
||||
@ -355,7 +357,8 @@ JS
|
||||
}
|
||||
|
||||
// check to see if there is a dynamic subject
|
||||
if ($recipient->SendEmailSubjectField()) {
|
||||
$emailSubject = $recipient->SendEmailSubjectField();
|
||||
if ($emailSubject && $emailSubject->exists()) {
|
||||
$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailSubjectField()->Name);
|
||||
|
||||
if ($submittedFormField && trim($submittedFormField->Value)) {
|
||||
|
Loading…
Reference in New Issue
Block a user