Skip to content

Commit ba2dfe3

Browse files
committed
Allowed optional installation of swiftmailer 6 if plattform >= PHP 7. Submodule for swiftmailer not required as it is also a dependency within composer.
1 parent 3622f22 commit ba2dfe3

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
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

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)