Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal: Restoring mail conf variables #5462

Merged
merged 18 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
af99f6a
Internal: Message: Restoring mail conf about SMTP_UNIQUE_SENDER - ref…
AngelFQC Apr 30, 2024
cbb5046
Internal: Message: Restoring mail conf about SMTP_FROM_EMAIL and SMTP…
AngelFQC Apr 30, 2024
bb5ca1c
Internal: Message: Restoring $creatorEmail param in api_mail_html fun…
AngelFQC May 2, 2024
9b89b3a
Internal: Admin: Move ENV parameters about smpt* to mail settings - r…
AngelFQC May 6, 2024
1e93c2b
Internal: Migrate settings from mail.conf.php about smpt* to mail set…
AngelFQC May 6, 2024
4df2c18
Internal: Message: Fix e-mail sender (if provided) - refs BT#20235
ywarnier Sep 27, 2022
6890bf5
Internal: Don't dispatch messenger bus to send mailer when post persi…
AngelFQC May 8, 2024
c5638e1
Internal: Move packages/dev/mailer.yaml configuration to packages/mai…
AngelFQC May 22, 2024
9925feb
Internal: Move packages/test/messenger.yaml configuration to packages…
AngelFQC May 22, 2024
02018cf
Internal: Move packages/test/mailer.yaml configuration to packages/me…
AngelFQC May 22, 2024
4092277
Vendor: Add league/html-to-markdown - refs BT#21613
AngelFQC May 22, 2024
6a43895
Internal: Remove defaut.text.twig template fro mail text content - re…
AngelFQC May 22, 2024
16f5645
Internal: Move function code from api_mail_html to MailHelper.php cla…
AngelFQC May 22, 2024
3b7125a
Internal: Remove MessageListener and MessageHandler - refs BT#21613
AngelFQC May 22, 2024
a0aef26
Internal: Add example configuration to use messenger transport for ma…
AngelFQC May 22, 2024
f1cf9a6
Internal: Use BodyRenderer before sending mails - refs BT#21613
AngelFQC May 22, 2024
bce4d95
Internal: Message: Send mail when saving inbox message - refs BT#21613
AngelFQC May 23, 2024
26cc577
Vendor: Add symfony/doctrine-messenger - refs BT#21613
AngelFQC May 23, 2024
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 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
Loading