Changes setBody() method call on Swift_Message into a html() or plain() based on second argument
$message = new Swift_Message();
-$message->setBody('...', 'text/html');
+$message->html('...');
-$message->setBody('...', 'text/plain');
-$message->setBody('...');
+$message->text('...');
+$message->text('...');
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\SwiftMailer\Rector\MethodCall\SwiftSetBodyToHtmlPlainMethodCallRector;
return RectorConfig::configure()
->withRules([
SwiftSetBodyToHtmlPlainMethodCallRector::class,
]);