Skip to content

Commit 5393adc

Browse files
authored
Merge pull request #1 from vemaeg/swiftmailer-6
Swiftmailer 6 back to master.
2 parents c71f1ab + ba2dfe3 commit 5393adc

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.gitmodules

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[submodule "lib/vendor/swiftmailer"]
2-
path = lib/vendor/swiftmailer
3-
url = https://github.com/swiftmailer/swiftmailer.git
4-
branch = 5.x
51
[submodule "lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine"]
62
path = lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine
73
url = https://github.com/LExpress/doctrine1.git

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Fork of symfony 1.4 with dic, form enhancements, latest swiftmailer and better performance",
44
"license": "MIT",
55
"require": {
6-
"swiftmailer/swiftmailer": "~5.2"
6+
"swiftmailer/swiftmailer": "~5.2|~6.0"
77
},
88
"require-dev": {
99
"psr/log": "*"

lib/mailer/sfMailer.class.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,17 @@ public function setDeliveryAddress($address)
239239
*/
240240
public function compose($from = null, $to = null, $subject = null, $body = null)
241241
{
242-
return Swift_Message::newInstance()
242+
$msg = null;
243+
244+
if(version_compare(Swift::VERSION, '6.0.0') >= 0) {
245+
$msg = new Swift_Message($subject);
246+
} else {
247+
$msg = Swift_Message::newInstance($subject);
248+
}
249+
250+
return $msg
243251
->setFrom($from)
244252
->setTo($to)
245-
->setSubject($subject)
246253
->setBody($body)
247254
;
248255
}
@@ -277,12 +284,12 @@ public function sendNextImmediately()
277284
/**
278285
* Sends the given message.
279286
*
280-
* @param Swift_Transport $transport A transport instance
287+
* @param Swift_Message $message A transport instance
281288
* @param string[] &$failedRecipients An array of failures by-reference
282289
*
283290
* @return int|false The number of sent emails
284291
*/
285-
public function send(Swift_Mime_Message $message, &$failedRecipients = null)
292+
public function send(Swift_Message $message, &$failedRecipients = null)
286293
{
287294
if ($this->force)
288295
{

lib/vendor/swiftmailer

-1
This file was deleted.

0 commit comments

Comments
 (0)