Skip to content

Commit

Permalink
Add option to overwriteFromEmailAdressToOwner
Browse files Browse the repository at this point in the history
  • Loading branch information
chrode committed Jul 9, 2024
1 parent 730465a commit 4e72dd5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Classes/Controller/EmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ public function createAction(\Slub\SlubForms\Domain\Model\Email $newEmail, array

}

} else if ($field->getType() == 'Captcha') {

$content[$field->getTitle()] = '-';

} else {

$content[$field->getTitle()] = empty($getfields[$field->getUid()]) ? '-' : $getfields[$field->getUid()];
Expand Down Expand Up @@ -341,9 +345,15 @@ public function createAction(\Slub\SlubForms\Domain\Model\Email $newEmail, array
}

// email to form owner

$senderEmail = $newEmail->getSenderEmail();
if($this->settings['overwriteFromEmailAdressToOwner'] && strlen($this->settings['overwriteFromEmailAdressToOwner']) > 0) {
$senderEmail = $this->settings['overwriteFromEmailAdressToOwner'];
}

$this->sendTemplateEmail(
array($form->getRecipient() => ''),
array($newEmail->getSenderEmail() => $newEmail->getSenderName()),
array($senderEmail => $newEmail->getSenderName()),
LocalizationUtility::translate('tx_slubforms_domain_model_email.form', 'slub_forms') . ': ' . $form->getTitle() . ': '. $newEmail->getSenderName(). ', '. $newEmail->getSenderEmail() ,
'FormEmail',
array( 'email' => $newEmail,
Expand Down
2 changes: 2 additions & 0 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ plugin.tx_slubforms {
settings {
senderEmailAddress = [email protected]

overwriteFromEmailAdressToOwner = [email protected]

// allow sending anonymous mails
#anonymEmails {
# allow = 1
Expand Down

0 comments on commit 4e72dd5

Please sign in to comment.