| 1 | <?php |
||
| 12 | abstract class SendEmail |
||
| 13 | { |
||
| 14 | use LoggerAwareTrait; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param LoggerInterface|null $logger |
||
| 18 | */ |
||
| 19 | 4 | public function __construct( |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @param Email $email |
||
| 27 | * @param int $maxAttempts |
||
| 28 | * @param SmtpConfiguration|null $smtpConfiguration |
||
| 29 | * @return int |
||
| 30 | * @throws EmailNotSentException |
||
| 31 | * @throws Throwable |
||
| 32 | */ |
||
| 33 | 3 | public function execute(Email $email, int $maxAttempts = 1, SmtpConfiguration $smtpConfiguration = null): int |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @param Email $email |
||
| 53 | * @param SmtpConfiguration|null $smtpConfiguration |
||
| 54 | * @return int |
||
| 55 | * @throws EmailNotSentException |
||
| 56 | */ |
||
| 57 | abstract protected function doExecute(Email $email, SmtpConfiguration $smtpConfiguration = null): int; |
||
| 58 | } |
||
| 59 |