Merge remote-tracking branch 'origin/master' into rector/rules-symfony

# Conflicts:
#	src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php
#	src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php
This commit is contained in:
2023-09-12 15:21:15 +02:00
57 changed files with 1011 additions and 178 deletions

View File

@@ -31,13 +31,18 @@ class NotificationMailer
public function postPersistComment(NotificationComment $comment, PostPersistEventArgs $eventArgs): void
{
foreach (
array_merge(
$comment->getNotification()->getAddressees()->toArray(),
[$comment->getNotification()->getSender()]
) as $dest
) {
if (null === $dest->getEmail() || $comment->getCreatedBy() !== $dest) {
$dests = [$comment->getNotification()->getSender(), ...$comment->getNotification()->getAddressees()->toArray()];
$uniqueDests = [];
foreach ($dests as $dest) {
// avoid duplication
if (in_array(spl_object_hash($dest), $uniqueDests, true)) {
continue;
}
$uniqueDests[] = spl_object_hash($dest);
// do not send if the sender does not have any email, nor to the creator of the comment
if (null === $dest->getEmail() || $comment->getCreatedBy() === $dest) {
continue;
}
$email = new TemplatedEmail();