Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Yii Framework 2 Symfony mailer extension Change Log
4.0.1 under development
-----------------------

- Enh #80: Add support for Azure Email Communication Services (bijoys)

4.0.0 Jan 29, 2024
------------------

Expand Down
1 change: 1 addition & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"symbol-whitelist": [
"Symfony\\Component\\Mailer\\Bridge\\Amazon\\Transport\\SesTransportFactory",
"Symfony\\Component\\Mailer\\Bridge\\Azure\\Transport\\AzureTransportFactory",
"Symfony\\Component\\Mailer\\Bridge\\Google\\Transport\\GmailTransportFactory",
"Symfony\\Component\\Mailer\\Bridge\\Infobip\\Transport\\InfobipTransportFactory",
"Symfony\\Component\\Mailer\\Bridge\\Mailchimp\\Transport\\MandrillTransportFactory",
Expand Down
1 change: 1 addition & 0 deletions src/DkimMessageSigner.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
Expand Down
2 changes: 2 additions & 0 deletions src/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory;
use Symfony\Component\Mailer\Transport\TransportInterface;
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
use Symfony\Component\Mailer\Bridge\Azure\Transport\AzureTransportFactory;
use Symfony\Component\Mailer\Bridge\Google\Transport\GmailTransportFactory;
use Symfony\Component\Mailer\Bridge\Infobip\Transport\InfobipTransportFactory;
use Symfony\Component\Mailer\Bridge\Mailchimp\Transport\MandrillTransportFactory;
Expand Down Expand Up @@ -103,6 +104,7 @@
EsmtpTransportFactory::class,
NativeTransportFactory::class,
SesTransportFactory::class,
AzureTransportFactory::class,
GmailTransportFactory::class,
InfobipTransportFactory::class,
MandrillTransportFactory::class,
Expand All @@ -114,7 +116,7 @@
SendinblueTransportFactory::class,
] as $factoryClass) {
if (!class_exists($factoryClass)) {
continue;

Check warning on line 119 in src/Mailer.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ $factories = []; foreach ([NullTransportFactory::class, SendmailTransportFactory::class, EsmtpTransportFactory::class, NativeTransportFactory::class, SesTransportFactory::class, AzureTransportFactory::class, GmailTransportFactory::class, InfobipTransportFactory::class, MandrillTransportFactory::class, MailgunTransportFactory::class, MailjetTransportFactory::class, OhMySmtpTransportFactory::class, PostmarkTransportFactory::class, SendgridTransportFactory::class, SendinblueTransportFactory::class] as $factoryClass) { if (!class_exists($factoryClass)) { - continue; + break; } $factories[] = Yii::$container->get($factoryClass); }
}
$factories[] = Yii::$container->get($factoryClass);
}
Expand Down Expand Up @@ -178,6 +180,6 @@
$message = $this->signer->sign($message, $this->signerOptions);
}
$this->getTransport()->send($message);
return true;

Check warning on line 183 in src/Mailer.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ $message = $this->signer->sign($message, $this->signerOptions); } $this->getTransport()->send($message); - return true; + return false; } }
}
}
4 changes: 2 additions & 2 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public function __construct(array $config = [])
{
$this->email = new Email();
parent::__construct($config);

Check warning on line 42 in src/Message.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ public function __construct(array $config = []) { $this->email = new Email(); - parent::__construct($config); + } public function __clone() {
}

public function __clone()
Expand Down Expand Up @@ -244,7 +244,7 @@
$this->email->attachFromPath(
$fileName,
$options['fileName'] ?? $fileName,
$options['contentType'] ?? FileHelper::getMimeType($fileName)
$options['contentType'] ?? FileHelper::getMimeType($fileName),
);
return $this;
}
Expand Down Expand Up @@ -272,9 +272,9 @@
$this->email->embedFromPath(
$fileName,
$name,
$options['contentType'] ?? FileHelper::getMimeType($fileName)
$options['contentType'] ?? FileHelper::getMimeType($fileName),
);
return 'cid:' . $name;

Check warning on line 277 in src/Message.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ { $name = $options['fileName'] ?? $fileName; $this->email->embedFromPath($fileName, $name, $options['contentType'] ?? FileHelper::getMimeType($fileName)); - return 'cid:' . $name; + return 'cid:'; } /** * @param resource|string $content
}

/**
Expand All @@ -288,7 +288,7 @@
throw new InvalidConfigException('A valid file name must be passed when embedding content');
}
$this->email->embed($content, $options['fileName'], $options['contentType'] ?? null);
return 'cid:' . $options['fileName'];

Check warning on line 291 in src/Message.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ throw new InvalidConfigException('A valid file name must be passed when embedding content'); } $this->email->embed($content, $options['fileName'], $options['contentType'] ?? null); - return 'cid:' . $options['fileName']; + return 'cid:'; } /** * @return list<string>
}

/**
Expand Down Expand Up @@ -391,7 +391,7 @@
if (!is_string($address)) {
// email address without name
$addresses[] = new Address($name);
continue;

Check warning on line 394 in src/Message.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ if (!is_string($address)) { // email address without name $addresses[] = new Address($name); - continue; + break; } $addresses[] = new Address($address, $name); }
}

$addresses[] = new Address($address, $name);
Expand Down
1 change: 1 addition & 0 deletions src/MessageEncrypterInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
Expand Down
1 change: 1 addition & 0 deletions src/MessageSignerInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
Expand Down
1 change: 1 addition & 0 deletions src/MessageWrapperInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
Expand Down
1 change: 1 addition & 0 deletions src/SMimeMessageEncrypter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
Expand Down
1 change: 1 addition & 0 deletions src/SMimeMessageSigner.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
Expand Down