File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -149,18 +149,20 @@ public function message(): MimeMessage
149
149
public function reply (Mailable $ mailable )
150
150
{
151
151
if ($ mailable instanceof \Illuminate \Mail \Mailable) {
152
- if (app ()->version () >= 9 ) {
153
- $ mailable ->withSwiftMessage (function (\Swift_Message $ message ) {
154
- $ message ->getHeaders ()->addIdHeader ('In-Reply-To ' , $ this ->id ());
152
+ $ usesSymfonyMailer = version_compare (app ()->version (), '9.0.0 ' , '> ' );
153
+
154
+ if ($ usesSymfonyMailer ) {
155
+ $ mailable ->withSymfonyMessage (function (\Symfony \Component \Mime \Email $ email ) {
156
+ $ email ->getHeaders ()->addIdHeader ('In-Reply-To ' , $ this ->id ());
155
157
});
156
158
} else {
157
- $ mailable ->withSymfonyMessage (function (\Swift_Message $ message ) {
159
+ $ mailable ->withSwiftMessage (function (\Swift_Message $ message ) {
158
160
$ message ->getHeaders ()->addIdHeader ('In-Reply-To ' , $ this ->id ());
159
161
});
160
162
}
161
163
}
162
164
163
- return Mail::to ($ this ->from ())->send ($ mailable );
165
+ return Mail::to ($ this ->headerValue ( ' Reply-To ' ) ?: $ this -> from ())->send ($ mailable );
164
166
}
165
167
166
168
public function forward ($ recipients )
You can’t perform that action at this time.
0 commit comments