Skip to content

Commit

Permalink
Merge pull request #1 from macjohnny/patch-1
Browse files Browse the repository at this point in the history
update example signal slot
  • Loading branch information
einpraegsam authored Jun 24, 2016
2 parents 20aec4a + 5cd573a commit e8cadf9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Classes/Domain/Service/SendMailService.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace In2code\Powermailextended\Domain\Service;

use In2code\Powermail\Domain\Service\SendMailService as SendMailServicePowermail;
use TYPO3\CMS\Core\Mail\MailMessage;

/**
Expand All @@ -15,14 +16,15 @@ class SendMailService
* Manipulate message object short before powermail send the mail
*
* @param MailMessage $message
* @param array $email
* @param SendMailServicePowermail $originalService
*/
public function manipulateMail($message)
public function manipulateMail($message, &$email, SendMailServicePowermail $originalService)
{
// overwrite the receiver
$message->setTo(
[
'anotheremail@domain.org' => 'receiverName'
]
);
// overwrite the receiver in the email array to have it saved correctly!
$email['receiverName'] = 'John Mega';
$email['receiverEmail'] = 'john@mega.com';

$message->setTo([$email['receiverEmail'] => $email['receiverName']]);
}
}

0 comments on commit e8cadf9

Please sign in to comment.