Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SendIt] Add custom header #1204

Open
gam6itko opened this issue Jan 19, 2025 · 0 comments
Open

[SendIt] Add custom header #1204

gam6itko opened this issue Jan 19, 2025 · 0 comments
Labels

Comments

@gam6itko
Copy link
Contributor

gam6itko commented Jan 19, 2025

Description

I need add some custom header to mail for testing purposes.
Something like:

X-Some-Secret-Code-From-Email: 123
X-New-User-Password: qwerty
  • We could add new property $customHeaders to Mailer

  • Pass it here.

  • Handle it on mail render here

UPD it will be great to give user customize final email

For example add evend dispatch here.

$msg = new Email();

if ($message->getFrom() !== null) {
    $msg->from($message->getFrom());
}

$msg->to(...$message->getTo());
$msg->cc(...$message->getCC());
$msg->bcc(...$message->getBCC());

// new feature
$event = $this->eventDispatcher->dispatch(new PreRenderEvent(message: $message, email: $msg));

try {
    // render message partials
    $view->render(\array_merge(['_msg_' => $event->email], $event->message->getData()));
} catch (ViewException $e) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant