We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm currently using a fork of this package to add support for subaccounts. Here is my change to src/Transport/SparkPostTransport.php:
public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage { $recipients = $this->getRecipients($message); $headers = ['Authorization' => $this->key]; $subaccount_id = $message->getHeaders()->get('subaccount_id'); if ($subaccount_id) { $headers['X-MSYS-SUBACCOUNT'] = $subaccount_id->getValue(); } $response = $this->client->request('POST', $this->getEndpoint() . '/transmissions', [ 'headers' => $headers, 'json' => array_merge([ ...
To add a subaccount to a message, add it to the message headers in a Mailable:
$this->withSymfonyMessage(function ($message) use ($subaccount_id) { $headers = $message->getHeaders(); $headers->addTextHeader('subaccount_id', $subaccount_id); });
I'd be happy to submit this as a PR.
The text was updated successfully, but these errors were encountered:
Hi @wittsparks seems ok, create a PR and we will look into it.
Sorry, something went wrong.
Thanks for the PR, its merged
No branches or pull requests
I'm currently using a fork of this package to add support for subaccounts. Here is my change to src/Transport/SparkPostTransport.php:
To add a subaccount to a message, add it to the message headers in a Mailable:
I'd be happy to submit this as a PR.
The text was updated successfully, but these errors were encountered: