-
Notifications
You must be signed in to change notification settings - Fork 480
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
Conversation
b3a67d5
to
8183c3b
Compare
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
class Version20240506164100 extends AbstractMigrationChamilo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing class doc comment
|
||
$this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable, access_url_locked) VALUES ('smtp_from_name', null, null, 'mail', '$selectedMailValue', 'smtp_from_name', null, '', null, 1, 1, 1)"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 1 newline at end of file; 0 found
@@ -163,6 +163,21 @@ public function getConfigurationValue($variable, $configuration = null) | |||
return false; | |||
} | |||
|
|||
public function getMailConfigurationValue(string $variable, array $configuration = []): mixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing function doc comment
@@ -163,6 +163,21 @@ | |||
return false; | |||
} | |||
|
|||
public function getMailConfigurationValue(string $variable, array $configuration = []): mixed | |||
{ | |||
global $platform_email; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "platform_email" is not in valid camel caps format
global $platform_email; | ||
|
||
if ($configuration) { | ||
$platform_email = $configuration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "platform_email" is not in valid camel caps format
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
declare(strict_types=1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a single space around assignment operators
$platform_email = $configuration; | ||
} | ||
|
||
if (isset($platform_email[$variable])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "platform_email" is not in valid camel caps format
} | ||
|
||
if (isset($platform_email[$variable])) { | ||
return $platform_email[$variable]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "platform_email" is not in valid camel caps format
@@ -332,4 +347,28 @@ | |||
|
|||
return $this->entityManager->find(Session::class, $id); | |||
} | |||
|
|||
public function getMailConfigurationValueFromFile(string $variable): ?string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing function doc comment
|
||
public function getMailConfigurationValueFromFile(string $variable): ?string | ||
{ | ||
global $platform_email; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "platform_email" is not in valid camel caps format
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5462 +/- ##
============================================
+ Coverage 39.78% 40.22% +0.43%
+ Complexity 10602 10352 -250
============================================
Files 842 823 -19
Lines 44320 43573 -747
============================================
- Hits 17634 17526 -108
+ Misses 26686 26047 -639 ☔ View full report in Codecov by Sentry. |
…_FROM_NAME - refs BT#21613
…ction - refs BT#21613
…tings - refs BT#21613
Also might affect other e-mail sending processes. Was using global platform sender setting before, no matter what.
…sting a message - refs BT#21613
…ler.yaml - refs BT#21613
…/messenger.yaml - refs BT#21613
…ssenger.yaml - refs BT#21613
…fs BT#21613 The text content for mails will be generated from HTML content with league/html-to-markdown
…ss - refs BT#21613
$body, | ||
$senderName, | ||
$senderEmail, | ||
$extra_headers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "extra_headers" is not in valid camel caps format
$senderName, | ||
$senderEmail, | ||
$extra_headers, | ||
$data_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "data_file" is not in valid camel caps format
include_once $oldConfigPath; | ||
} | ||
|
||
$settingValue = $this->getConfigurationValue($variable, $platform_email); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "platform_email" is not in valid camel caps format
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
declare(strict_types=1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a single space around assignment operators
use Symfony\Component\Mime\Address; | ||
use Symfony\Component\Mime\BodyRendererInterface; | ||
|
||
final class MailHelper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing class doc comment
|
||
final class MailHelper | ||
{ | ||
public function __construct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing function doc comment
final class MailHelper | ||
{ | ||
public function __construct( | ||
private readonly MailerInterface $mailer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 4 spaces, found 8
{ | ||
public function __construct( | ||
private readonly MailerInterface $mailer, | ||
private readonly BodyRendererInterface $bodyRenderer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected 4 spaces, found 8
public function __construct( | ||
private readonly MailerInterface $mailer, | ||
private readonly BodyRendererInterface $bodyRenderer, | ||
) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing brace must be on a line by itself
public function __construct( | ||
private readonly MailerInterface $mailer, | ||
private readonly BodyRendererInterface $bodyRenderer, | ||
) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing brace must be on a line by itself
An error occurred when fetching issues. View more on Code Climate. |
Refs BT#21613