Skip to content

Commit 6e92ebb

Browse files
committed
Build stabilization
1 parent d7ecf5f commit 6e92ebb

File tree

6 files changed

+74
-86
lines changed

6 files changed

+74
-86
lines changed

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,66 @@
311311
<label>System</label>
312312
<tab>advanced</tab>
313313
<resource>Magento_Config::config_system</resource>
314+
<group id="smtp" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
315+
<label>Mail Sending Settings</label>
316+
<field id="disable" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
317+
<label>Disable Email Communications</label>
318+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
319+
</field>
320+
<field id="transport" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
321+
<label>Transport</label>
322+
<source_model>Magento\Email\Model\Config\Source\SmtpTransportType</source_model>
323+
</field>
324+
<field id="host" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
325+
<label>Host</label>
326+
<comment>For SMTP and Windows server only.</comment>
327+
</field>
328+
<field id="port" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
329+
<label>Port (25)</label>
330+
<validate>validate-digits validate-digits-range digits-range-0-65535</validate>
331+
<comment>Please enter at least 0 and at most 65535 (For SMTP and Windows server only).</comment>
332+
</field>
333+
<field id="set_return_path" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
334+
<label>Set Return-Path</label>
335+
<source_model>Magento\Config\Model\Config\Source\Yesnocustom</source_model>
336+
</field>
337+
<field id="return_path_email" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
338+
<label>Return-Path Email</label>
339+
<validate>validate-email</validate>
340+
<backend_model>Magento\Config\Model\Config\Backend\Email\Address</backend_model>
341+
<depends>
342+
<field id="set_return_path">2</field>
343+
</depends>
344+
</field>
345+
<field id="username" translate="label comment" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
346+
<label>Username</label>
347+
<comment>Username</comment>
348+
<depends>
349+
<field id="transport">smtp</field>
350+
</depends>
351+
</field>
352+
<field id="password" translate="label comment" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
353+
<label>Password</label>
354+
<comment>Username</comment>
355+
<depends>
356+
<field id="transport">smtp</field>
357+
</depends>
358+
</field>
359+
<field id="auth" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
360+
<label>Auth</label>
361+
<source_model>Magento\Email\Model\Config\Source\SmtpAuthType</source_model>
362+
<depends>
363+
<field id="transport">smtp</field>
364+
</depends>
365+
</field>
366+
<field id="ssl" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
367+
<label>SSL</label>
368+
<source_model>Magento\Email\Model\Config\Source\SmtpSslType</source_model>
369+
<depends>
370+
<field id="transport">smtp</field>
371+
</depends>
372+
</field>
373+
</group>
314374
<group id="upload_configuration" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
315375
<label>Images Upload Configuration</label>
316376
<field id="enable_resize" translate="label comment" type="select" sortOrder="200" showInDefault="1" canRestore="1">

app/code/Magento/Email/Model/Config/Source/SmtpAuthType.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class SmtpAuthType implements \Magento\Framework\Data\OptionSourceInterface
2121
public function toOptionArray(): array
2222
{
2323
return [
24-
['value' => 'none', 'label' => 'NONE'],
25-
['value' => 'plain', 'label' => 'PLAIN'],
26-
['value' => 'login', 'label' => 'LOGIN'],
27-
// ['value' => 'crammd5', 'label' => 'CRAM-MD5 '], // Requires laminas/laminas-crypt
24+
['value' => 'none', 'label' => __('NONE')],
25+
['value' => 'plain', 'label' => __('PLAIN')],
26+
['value' => 'login', 'label' => __('LOGIN')],
27+
// ['value' => 'crammd5', 'label' => __('CRAM-MD5) '], // Requires laminas/laminas-crypt
2828
];
2929
}
3030
}

app/code/Magento/Email/Model/Config/Source/SmtpSslType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class SmtpSslType implements \Magento\Framework\Data\OptionSourceInterface
2121
public function toOptionArray(): array
2222
{
2323
return [
24-
['value' => 'none', 'label' => 'None'],
25-
['value' => 'ssl', 'label' => 'SSL'],
26-
['value' => 'tls', 'label' => 'TLS'],
24+
['value' => 'none', 'label' => __('None')],
25+
['value' => 'ssl', 'label' => __('SSL')],
26+
['value' => 'tls', 'label' => __('TLS')],
2727
];
2828
}
2929
}

app/code/Magento/Email/Model/Config/Source/SmtpTransportType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class SmtpTransportType implements \Magento\Framework\Data\OptionSourceInterface
2222
public function toOptionArray(): array
2323
{
2424
return [
25-
['value' => 'sendmail', 'label' => 'Sendmail'],
26-
['value' => 'smtp', 'label' => 'SMTP'],
25+
['value' => 'sendmail', 'label' => __('Sendmail')],
26+
['value' => 'smtp', 'label' => __('SMTP')],
2727
];
2828
}
2929
}

app/code/Magento/Email/Model/Transport.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,20 @@
2424
/**
2525
* Class that responsible for filling some message data before transporting it.
2626
* @see \Laminas\Mail\Transport\Sendmail is used for transport
27+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2728
*/
2829
class Transport implements TransportInterface
2930
{
3031
/**
3132
* Configuration path to source of Return-Path and whether it should be set at all
3233
* @see \Magento\Config\Model\Config\Source\Yesnocustom to possible values
3334
*/
34-
const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path';
35+
private const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path';
3536

3637
/**
3738
* Configuration path for custom Return-Path email
3839
*/
39-
const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email';
40+
private const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email';
4041

4142
/**
4243
* Configuration path for custom Transport
@@ -244,7 +245,7 @@ private function createSmtpTransport(): Smtp
244245
if ($auth && $auth !== 'none') {
245246
$options['connection_class'] = $auth;
246247
}
247-
248+
248249
if ($ssl && $ssl !== 'none') {
249250
$options['connection_config']['ssl'] = $ssl;
250251
}
@@ -257,7 +258,7 @@ private function createSmtpTransport(): Smtp
257258

258259
/**
259260
* Create a Sendmail Laminas Transport
260-
*
261+
*
261262
* @return Sendmail
262263
*/
263264
private function createSendmailTransport(): Sendmail

app/code/Magento/Email/etc/adminhtml/system.xml

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)