Merge pull request #853 from dnadesign/fix/reply-to-not-set

Check recipient alternate from/to fields exists
This commit is contained in:
Dylan Wagstaff 2019-01-17 14:02:23 +13:00 committed by GitHub
commit 2d310a38f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {