Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 3 additions & 2 deletions config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ return [
'contact' => [
'notification_receivers' => [],
'message_receivers' => [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like the string 'receiver'.
In email world, the standard string is 'recipients'
At least for me , 'receiver' is confusing
@alexmerlin your opionion ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea might be dropping the "contact" key from local.php altogether, as the only part it's used by default is the sendContactMail function in MessageService.php.

That function already uses the config file from dot-mail (mail.global.php) for the "addFrom" method, and that has the to and cc keys available as well.

Copy link
Member

@arhimede arhimede Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea might be dropping the "contact" key from local.php altogether, as the only part it's used by default is the sendContactMail function in MessageService.php.

That function already uses the config file from dot-mail (mail.global.php) for the "addFrom" method, and that has the to and cc keys available as well.

Let' discuss tomorrow
as i do not like either the line from MessageService.php
$this->config['contact']['message_receivers']['to'],
$this->config['contact']['message_receivers']['cc'],

'to' => [
'name' => 'Dotkernel Team',
'to' => [
'[email protected]',
],
'cc' => [
'cc' => [
'[email protected]',
],
],
Expand Down
4 changes: 2 additions & 2 deletions src/Contact/src/Service/MessageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public function sendContactMail(Message $message): bool
);
$this->mailService->getMessage()->addTo(
$this->config['contact']['message_receivers']['to'],
'Dotkernel Team'
$this->config['contact']['message_receivers']['name']
);
$this->mailService->getMessage()->addCC(
$this->config['contact']['message_receivers']['cc'],
'Dotkernel Team'
$this->config['contact']['message_receivers']['name']
);
$this->mailService->getMessage()->setReplyTo($message->getEmail(), $message->getName());

Expand Down
5 changes: 3 additions & 2 deletions test/Unit/Contact/Service/MessageServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ public function testProcessMessage(): void
[
'contact' => [
'message_receivers' => [
'to' => '[email protected]',
'cc' => '[email protected]',
'to' => '[email protected]',
'cc' => '[email protected]',
'name' => 'Dotkernel Team',
],
],
'dot_mail' => [
Expand Down