Skip to content

Commit

Permalink
Merge pull request #5462 from AngelFQC/BT21613
Browse files Browse the repository at this point in the history
Internal: Restoring mail conf variables
  • Loading branch information
NicoDucou committed May 24, 2024
2 parents 9577490 + 26cc577 commit 119efed
Show file tree
Hide file tree
Showing 22 changed files with 557 additions and 232 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"laminas/laminas-permissions-acl": "~2.8",
"league/csv": "^9.7",
"league/glide-symfony": "^2.0",
"league/html-to-markdown": "^5.1",
"league/mime-type-detection": "^1.7",
"lexik/jwt-authentication-bundle": "^2.20",
"maennchen/zipstream-php": "^2.1",
Expand All @@ -120,6 +121,7 @@
"symfony/apache-pack": "^1.0",
"symfony/asset": "6.4.*",
"symfony/cache": "6.4.*",
"symfony/doctrine-messenger": "6.4.*",
"symfony/dotenv": "6.4.*",
"symfony/expression-language": "6.4.*",
"symfony/flex": "^2.4",
Expand Down
163 changes: 162 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions config/packages/dev/mailer.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions config/packages/mailer.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
framework:
mailer:
dsn: '%env(MAILER_DSN)%'

when@dev:
framework:
mailer:
dsn: 'null://null'

when@test:
framework:
mailer:
dsn: 'null://null'
17 changes: 10 additions & 7 deletions config/packages/messenger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ framework:
# failed: 'doctrine://default?queue_name=failed'
# sync: 'sync://'

routing:
# Route your messages to the transports
'Chamilo\CoreBundle\Entity\Message': sync_priority_high
when@test:
framework:
messenger:
transports:
sync_priority_high: 'in-memory://'

# when@test:
#when@prod:
# framework:
# messenger:
# transports:
# # replace with your transport name here (e.g., my_transport: 'in-memory://')
# # For more Messenger testing tools, see https://github.com/zenstruck/messenger-test
# async: 'in-memory://'
# mail_async: "%env(MESSENGER_TRANSPORT_DSN)%"
#
# routing:
# 'Symfony\Component\Mailer\Messenger\SendEmailMessage': mail_async
3 changes: 0 additions & 3 deletions config/packages/test/mailer.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions config/packages/test/messenger.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ services:
$persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
$removeProcessor: '@api_platform.doctrine.orm.state.remove_processor'

Chamilo\CoreBundle\State\MessageProcessor:
bind:
$persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
$removeProcessor: '@api_platform.doctrine.orm.state.remove_processor'

Chamilo\CoreBundle\EventSubscriber\AnonymousUserSubscriber:
tags:
- name: kernel.event_subscriber
Expand Down
8 changes: 7 additions & 1 deletion public/main/admin/email_tester.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
* Index page of the admin tools.
*/
// Resetting the course id.
use Chamilo\CoreBundle\Framework\Container;

$cidReset = true;

// Including some necessary chamilo files.
require_once __DIR__.'/../inc/global.inc.php';

api_protect_admin_script();

$settingsManager = Container::getSettingsManager();

// Setting the section (for the tabs).
$this_section = SECTION_PLATFORM_ADMIN;
$toolName = get_lang('E-mail tester');
Expand Down Expand Up @@ -42,7 +46,9 @@
$values['subject'],
$values['content'],
UserManager::formatUserFullName($user),
$user->getEmail()
'true' === $settingsManager->getSetting('mail.smtp_unique_sender')
? $settingsManager->getSetting('mail.smtp_from_email')
: $user->getEmail()
);

Display::addFlash(
Expand Down
Loading

0 comments on commit 119efed

Please sign in to comment.