Skip to content

Commit

Permalink
Merge pull request #3 from interactive-solutions/feature/override-rep…
Browse files Browse the repository at this point in the history
…ly-to

Allow to set a custom reply-to header per message
  • Loading branch information
Hotas2k authored May 23, 2018
2 parents a91e864 + 752d264 commit a8ebc07
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/SendEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public function __invoke(SendEmailMessage $message)
$message->getEmail(),
$message->getTemplate(),
$message->getPayload(),
$message->getLocale()
$message->getLocale(),
$message->getReplyTo()
);

$console->writeLine(' success', ColorInterface::GREEN);
Expand Down
30 changes: 24 additions & 6 deletions src/SendEmailMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,29 @@ final class SendEmailMessage extends AbstractExplicitMessage
*/
private $locale;

/**
* @Serializer\Type("string")
*
* @var string
*/
private $replyTo;

/**
* SendNewPasswordEmailMessage constructor.
* @param string $email
* @param string $template
* @param array $payload
* @param string|null $locale
*
* @param string $email
* @param string $template
* @param array $payload
* @param string $locale
* @param string|null $replyTo
*/
public function __construct(string $email, string $template, array $payload, string $locale = null)
public function __construct(string $email, string $template, array $payload, string $locale = null, string $replyTo = null)
{
$this->email = $email;
$this->template = $template;
$this->payload = $payload;
$this->locale = $locale;
$this->replyTo = $replyTo;
}

/**
Expand Down Expand Up @@ -88,13 +98,21 @@ public function getPayload(): array
}

/**
* @return string
* @return string|null
*/
public function getLocale()
{
return $this->locale;
}

/**
* @return string|null
*/
public function getReplyTo()
{
return $this->replyTo;
}

public function getQueue(): string
{
return 'emails';
Expand Down

0 comments on commit a8ebc07

Please sign in to comment.