File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/Illuminate/Mail/Transport Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 55use Aws \Exception \AwsException ;
66use Aws \Ses \SesClient ;
77use Exception ;
8+ use Symfony \Component \Mailer \Header \MetadataHeader ;
89use Symfony \Component \Mailer \SentMessage ;
910use Symfony \Component \Mailer \Transport \AbstractTransport ;
11+ use Symfony \Component \Mime \Message ;
1012
1113class SesTransport extends AbstractTransport
1214{
@@ -44,10 +46,20 @@ public function __construct(SesClient $ses, $options = [])
4446 */
4547 protected function doSend (SentMessage $ message ): void
4648 {
49+ $ options = $ this ->options ;
50+
51+ if ($ message ->getOriginalMessage () instanceof Message) {
52+ foreach ($ message ->getOriginalMessage ()->getHeaders ()->all () as $ header ) {
53+ if ($ header instanceof MetadataHeader) {
54+ $ options ['EmailTags ' ][] = ['Name ' => $ header ->getKey (), 'Value ' => $ header ->getValue ()];
55+ }
56+ }
57+ }
58+
4759 try {
4860 $ this ->ses ->sendRawEmail (
4961 array_merge (
50- $ this -> options , [
62+ $ options , [
5163 'Source ' => $ message ->getEnvelope ()->getSender ()->toString (),
5264 'Destinations ' => collect ($ message ->getEnvelope ()->getRecipients ())
5365 ->map
You can’t perform that action at this time.
0 commit comments