Skip to content

Commit

Permalink
[BUGFIX] Make manipulateMailObjectOnCreate don't throw an exception o…
Browse files Browse the repository at this point in the history
…n other forms
  • Loading branch information
einpraegsam committed Aug 1, 2016
1 parent b58ed51 commit d03b833
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Controller/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class FormController
public function manipulateMailObjectOnCreate(Mail $mail)
{
// example how to get an answer from the mail object and manipulate a value (set firstname if email fits)
if ($mail->getAnswersByFieldMarker()['email']->getValue() === 'manipulatesender@powermailextended.org') {
if (
$mail->getAnswersByFieldMarker()['email'] !== null
&& $mail->getAnswersByFieldMarker()['email']->getValue() === 'manipulatesender@powermailextended.org'
) {
$mail->getAnswersByFieldMarker()['firstname']->setValue('heyholetsgo');
}
}
Expand Down

0 comments on commit d03b833

Please sign in to comment.