Skip to content

Commit 69eddbb

Browse files
committed
refactor: clarify config $from property
1 parent 6ad9d50 commit 69eddbb

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

packages/mailer/src/EmailToSymfonyEmailMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public function map(mixed $from, mixed $to): SymfonyEmail
4343

4444
if ($email->envelope->from) {
4545
$symfonyEmail->from(...$this->convertAddresses($email->envelope->from));
46-
} elseif ($this->mailerConfig->from) {
47-
$symfonyEmail->from($this->mailerConfig->from);
46+
} elseif ($this->mailerConfig->defaultExpeditor) {
47+
$symfonyEmail->from($this->mailerConfig->defaultExpeditor);
4848
} else {
4949
throw new ExpeditorWasMissing();
5050
}

packages/mailer/src/MailerConfig.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
namespace Tempest\Mail;
44

5+
use Symfony\Component\Mailer\Transport;
56
use Symfony\Component\Mailer\Transport\TransportInterface;
67

78
interface MailerConfig
89
{
910
/**
1011
* The transport class.
12+
*
13+
* @param class-string<Transport>
1114
*/
1215
public string $transport {
1316
get;
@@ -16,7 +19,7 @@ interface MailerConfig
1619
/**
1720
* The default address from which emails will be sent.
1821
*/
19-
public null|string|Address $from {
22+
public null|string|Address $defaultExpeditor {
2023
get;
2124
}
2225

packages/mailer/src/Transports/Postmark/PostmarkConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242
/**
4343
* Address from which emails are sent by default.
4444
*/
45-
public null|string|Address $from = null,
45+
public null|string|Address $defaultExpeditor = null,
4646

4747
/**
4848
* Whether to use Postmark's API or SMTP server.

packages/mailer/src/Transports/Ses/SesMailerConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(
5454
/**
5555
* Address from which emails are sent by default.
5656
*/
57-
public null|string|Address $from = null,
57+
public null|string|Address $defaultExpeditor = null,
5858

5959
/**
6060
* Whether to use Amazon SES's API or async HTTP transport.

packages/mailer/src/Transports/Smtp/SmtpMailerConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(
4646
/**
4747
* The default address from which emails will be sent.
4848
*/
49-
public null|string|Address $from = null,
49+
public null|string|Address $defaultExpeditor = null,
5050

5151
/**
5252
* Whether to use TLS for this connection.

0 commit comments

Comments
 (0)