From bfdeaef5dc06610337caa58d91faddb5b9168e0c Mon Sep 17 00:00:00 2001 From: MarioRadu Date: Tue, 10 Dec 2024 00:02:28 +0200 Subject: [PATCH 1/6] upgraded to dotkernel/dot-mail 5.0 Signed-off-by: MarioRadu --- composer.json | 2 +- config/autoload/mail.local.php.dist | 95 ----------------------------- config/config.php | 1 - 3 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 config/autoload/mail.local.php.dist diff --git a/composer.json b/composer.json index f853a573..45fff464 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,7 @@ "dotkernel/dot-data-fixtures": "^1.2.2", "dotkernel/dot-dependency-injection": "^1.0", "dotkernel/dot-errorhandler": "^4.0.0", - "dotkernel/dot-mail": "^4.1.1", + "dotkernel/dot-mail": "^5.0.0", "dotkernel/dot-response-header": "^3.2.3", "laminas/laminas-component-installer": "^3.4.0", "laminas/laminas-config-aggregator": "^1.14.0", diff --git a/config/autoload/mail.local.php.dist b/config/autoload/mail.local.php.dist deleted file mode 100644 index 038f50a3..00000000 --- a/config/autoload/mail.local.php.dist +++ /dev/null @@ -1,95 +0,0 @@ - [ -// the key is the mail service name, this is the default one, which does not extend any configuration - 'default' => [ -// tells which other mail service configuration to extend - 'extends' => null, - /** - * the mail transport to use - * can be any class implementing Laminas\Mail\Transport\TransportInterface - * - * for standard mail transports, you can use these aliases - * - sendmail => Laminas\Mail\Transport\Sendmail - * - smtp => Laminas\Mail\Transport\Smtp - * - file => Laminas\Mail\Transport\File - * - in_memory => Laminas\Mail\Transport\InMemory - * - * defaults to sendmail - **/ - 'transport' => Smtp::class, - /** - * Uncomment the below line if you want to save a copy of all sent emails to a certain IMAP folder. - * Valid only if the Transport is SMTP - */ -// 'save_sent_message_folder' => ['INBOX.Sent'], -// message configuration - 'message_options' => [ - 'from' => '', - 'from_name' => 'DotKernel', - 'reply_to' => '', - 'reply_to_name' => '', - 'to' => [], - 'cc' => [], - 'bcc' => [], - 'subject' => '', - 'body' => [ - 'content' => '', - 'charset' => 'utf-8', - ], - 'attachments' => [ - 'files' => [], - 'dir' => [ - 'iterate' => false, - 'path' => 'data/mail/attachments', - 'recursive' => false, - ], - ], - ], -// options that will be used only if Laminas\Mail\Transport\Smtp adapter is used - 'smtp_options' => [ - 'host' => 'smtp.gmail.com', - 'port' => 587, - 'connection_class' => 'login', - 'connection_config' => [ - 'username' => '', - 'password' => '', - 'ssl' => 'tls', - ], - ], -// file options that will be used only if the adapter is Laminas\Mail\Transport\File -// 'file_options' => [ -// 'path' => 'data/mail/output', -// //a callable that will get the Laminas\Mail\Transport\File object as an argument -// //and should return the filename if null is used, and empty callable will be used -// 'callback' => null, -// ], -// listeners to register with the mail service, for mail events - 'event_listeners' => [ -// [ -// 'type' => 'service or class name', -// 'priority' => 1, -// ], - ], - ], -// option to log the SENT emails - 'log' => [ - 'sent' => getcwd() . '/log/mail/sent.log', - ], - /** - * You can define other mail services here, with the same structure as the default block - * you can even extend from the default block, and overwrite only the differences - */ - ], -]; diff --git a/config/config.php b/config/config.php index 136ba5d2..513ff9d2 100644 --- a/config/config.php +++ b/config/config.php @@ -25,7 +25,6 @@ Laminas\Filter\ConfigProvider::class, Laminas\HttpHandlerRunner\ConfigProvider::class, Laminas\Hydrator\ConfigProvider::class, - Laminas\Mail\ConfigProvider::class, Laminas\Validator\ConfigProvider::class, // Include cache configuration new Laminas\ConfigAggregator\ArrayProvider($cacheConfig), From 8f99719521784f003fcffbfa6e315572b8764bcf Mon Sep 17 00:00:00 2001 From: MarioRadu Date: Tue, 10 Dec 2024 00:05:01 +0200 Subject: [PATCH 2/6] upgraded to dotkernel/dot-mail 5.0 Signed-off-by: MarioRadu --- .github/workflows/codecov.yml | 1 - .github/workflows/static-analysis.yml | 1 - .laminas-ci/pre-run.sh | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 293bb8eb..a823bb70 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -47,7 +47,6 @@ jobs: - name: Setup project run: | mv config/autoload/local.php.dist config/autoload/local.php - mv config/autoload/mail.local.php.dist config/autoload/mail.local.php mv config/autoload/local.test.php.dist config/autoload/local.test.php - name: Collect code coverage with PHPUnit diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 6a700f5d..ea461193 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -47,7 +47,6 @@ jobs: - name: Setup project run: | mv config/autoload/local.php.dist config/autoload/local.php - mv config/autoload/mail.local.php.dist config/autoload/mail.local.php mv config/autoload/local.test.php.dist config/autoload/local.test.php - name: Run static analysis with PHPStan diff --git a/.laminas-ci/pre-run.sh b/.laminas-ci/pre-run.sh index f6351b84..18fd755d 100755 --- a/.laminas-ci/pre-run.sh +++ b/.laminas-ci/pre-run.sh @@ -9,7 +9,6 @@ if [[ ${COMMAND} =~ phpunit ]];then apt-get install php"${PHP_VERSION}"-sqlite3 cp config/autoload/local.php.dist config/autoload/local.php - cp config/autoload/mail.local.php.dist config/autoload/mail.local.php cp config/autoload/local.test.php.dist config/autoload/local.test.php fi From 41d7232a3bbb9889bf402522cbb289957c568f95 Mon Sep 17 00:00:00 2001 From: MarioRadu Date: Tue, 10 Dec 2024 00:09:44 +0200 Subject: [PATCH 3/6] upgraded to dotkernel/dot-mail 5.0 Signed-off-by: MarioRadu --- .laminas-ci/pre-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.laminas-ci/pre-run.sh b/.laminas-ci/pre-run.sh index 18fd755d..f6351b84 100755 --- a/.laminas-ci/pre-run.sh +++ b/.laminas-ci/pre-run.sh @@ -9,6 +9,7 @@ if [[ ${COMMAND} =~ phpunit ]];then apt-get install php"${PHP_VERSION}"-sqlite3 cp config/autoload/local.php.dist config/autoload/local.php + cp config/autoload/mail.local.php.dist config/autoload/mail.local.php cp config/autoload/local.test.php.dist config/autoload/local.test.php fi From a01bd015cff2056e9d1047df508b9ca6a96e10a7 Mon Sep 17 00:00:00 2001 From: MarioRadu Date: Tue, 10 Dec 2024 00:11:53 +0200 Subject: [PATCH 4/6] upgraded to dotkernel/dot-mail 5.0 Signed-off-by: MarioRadu --- .github/workflows/codecov.yml | 1 + .github/workflows/static-analysis.yml | 1 + config/autoload/mail.local.php.dist | 95 +++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 config/autoload/mail.local.php.dist diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index a823bb70..293bb8eb 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -47,6 +47,7 @@ jobs: - name: Setup project run: | mv config/autoload/local.php.dist config/autoload/local.php + mv config/autoload/mail.local.php.dist config/autoload/mail.local.php mv config/autoload/local.test.php.dist config/autoload/local.test.php - name: Collect code coverage with PHPUnit diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index ea461193..6a700f5d 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -47,6 +47,7 @@ jobs: - name: Setup project run: | mv config/autoload/local.php.dist config/autoload/local.php + mv config/autoload/mail.local.php.dist config/autoload/mail.local.php mv config/autoload/local.test.php.dist config/autoload/local.test.php - name: Run static analysis with PHPStan diff --git a/config/autoload/mail.local.php.dist b/config/autoload/mail.local.php.dist new file mode 100644 index 00000000..038f50a3 --- /dev/null +++ b/config/autoload/mail.local.php.dist @@ -0,0 +1,95 @@ + [ +// the key is the mail service name, this is the default one, which does not extend any configuration + 'default' => [ +// tells which other mail service configuration to extend + 'extends' => null, + /** + * the mail transport to use + * can be any class implementing Laminas\Mail\Transport\TransportInterface + * + * for standard mail transports, you can use these aliases + * - sendmail => Laminas\Mail\Transport\Sendmail + * - smtp => Laminas\Mail\Transport\Smtp + * - file => Laminas\Mail\Transport\File + * - in_memory => Laminas\Mail\Transport\InMemory + * + * defaults to sendmail + **/ + 'transport' => Smtp::class, + /** + * Uncomment the below line if you want to save a copy of all sent emails to a certain IMAP folder. + * Valid only if the Transport is SMTP + */ +// 'save_sent_message_folder' => ['INBOX.Sent'], +// message configuration + 'message_options' => [ + 'from' => '', + 'from_name' => 'DotKernel', + 'reply_to' => '', + 'reply_to_name' => '', + 'to' => [], + 'cc' => [], + 'bcc' => [], + 'subject' => '', + 'body' => [ + 'content' => '', + 'charset' => 'utf-8', + ], + 'attachments' => [ + 'files' => [], + 'dir' => [ + 'iterate' => false, + 'path' => 'data/mail/attachments', + 'recursive' => false, + ], + ], + ], +// options that will be used only if Laminas\Mail\Transport\Smtp adapter is used + 'smtp_options' => [ + 'host' => 'smtp.gmail.com', + 'port' => 587, + 'connection_class' => 'login', + 'connection_config' => [ + 'username' => '', + 'password' => '', + 'ssl' => 'tls', + ], + ], +// file options that will be used only if the adapter is Laminas\Mail\Transport\File +// 'file_options' => [ +// 'path' => 'data/mail/output', +// //a callable that will get the Laminas\Mail\Transport\File object as an argument +// //and should return the filename if null is used, and empty callable will be used +// 'callback' => null, +// ], +// listeners to register with the mail service, for mail events + 'event_listeners' => [ +// [ +// 'type' => 'service or class name', +// 'priority' => 1, +// ], + ], + ], +// option to log the SENT emails + 'log' => [ + 'sent' => getcwd() . '/log/mail/sent.log', + ], + /** + * You can define other mail services here, with the same structure as the default block + * you can even extend from the default block, and overwrite only the differences + */ + ], +]; From 2d4431d16c2d1da0034914ac550ff00a38f4d8ad Mon Sep 17 00:00:00 2001 From: MarioRadu Date: Tue, 10 Dec 2024 00:36:51 +0200 Subject: [PATCH 5/6] upgraded to dotkernel/dot-mail 5.0 Signed-off-by: MarioRadu --- .github/workflows/codecov.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- .laminas-ci/pre-run.sh | 2 +- composer.json | 2 +- config/autoload/mail.local.php.dist | 95 --------------------------- 5 files changed, 4 insertions(+), 99 deletions(-) delete mode 100644 config/autoload/mail.local.php.dist diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 293bb8eb..fd128887 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -47,7 +47,7 @@ jobs: - name: Setup project run: | mv config/autoload/local.php.dist config/autoload/local.php - mv config/autoload/mail.local.php.dist config/autoload/mail.local.php + mv config/autoload/mail.global.php.dist config/autoload/mail.global.php mv config/autoload/local.test.php.dist config/autoload/local.test.php - name: Collect code coverage with PHPUnit diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 6a700f5d..abcab1f8 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -47,7 +47,7 @@ jobs: - name: Setup project run: | mv config/autoload/local.php.dist config/autoload/local.php - mv config/autoload/mail.local.php.dist config/autoload/mail.local.php + mv config/autoload/mail.global.php.dist config/autoload/mail.global.php mv config/autoload/local.test.php.dist config/autoload/local.test.php - name: Run static analysis with PHPStan diff --git a/.laminas-ci/pre-run.sh b/.laminas-ci/pre-run.sh index f6351b84..3a38c16a 100755 --- a/.laminas-ci/pre-run.sh +++ b/.laminas-ci/pre-run.sh @@ -9,7 +9,7 @@ if [[ ${COMMAND} =~ phpunit ]];then apt-get install php"${PHP_VERSION}"-sqlite3 cp config/autoload/local.php.dist config/autoload/local.php - cp config/autoload/mail.local.php.dist config/autoload/mail.local.php + cp config/autoload/mail.global.php.dist config/autoload/mail.global.php cp config/autoload/local.test.php.dist config/autoload/local.test.php fi diff --git a/composer.json b/composer.json index 45fff464..808729c4 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,7 @@ "dotkernel/dot-data-fixtures": "^1.2.2", "dotkernel/dot-dependency-injection": "^1.0", "dotkernel/dot-errorhandler": "^4.0.0", - "dotkernel/dot-mail": "^5.0.0", + "dotkernel/dot-mail": "^5.1.0", "dotkernel/dot-response-header": "^3.2.3", "laminas/laminas-component-installer": "^3.4.0", "laminas/laminas-config-aggregator": "^1.14.0", diff --git a/config/autoload/mail.local.php.dist b/config/autoload/mail.local.php.dist deleted file mode 100644 index 038f50a3..00000000 --- a/config/autoload/mail.local.php.dist +++ /dev/null @@ -1,95 +0,0 @@ - [ -// the key is the mail service name, this is the default one, which does not extend any configuration - 'default' => [ -// tells which other mail service configuration to extend - 'extends' => null, - /** - * the mail transport to use - * can be any class implementing Laminas\Mail\Transport\TransportInterface - * - * for standard mail transports, you can use these aliases - * - sendmail => Laminas\Mail\Transport\Sendmail - * - smtp => Laminas\Mail\Transport\Smtp - * - file => Laminas\Mail\Transport\File - * - in_memory => Laminas\Mail\Transport\InMemory - * - * defaults to sendmail - **/ - 'transport' => Smtp::class, - /** - * Uncomment the below line if you want to save a copy of all sent emails to a certain IMAP folder. - * Valid only if the Transport is SMTP - */ -// 'save_sent_message_folder' => ['INBOX.Sent'], -// message configuration - 'message_options' => [ - 'from' => '', - 'from_name' => 'DotKernel', - 'reply_to' => '', - 'reply_to_name' => '', - 'to' => [], - 'cc' => [], - 'bcc' => [], - 'subject' => '', - 'body' => [ - 'content' => '', - 'charset' => 'utf-8', - ], - 'attachments' => [ - 'files' => [], - 'dir' => [ - 'iterate' => false, - 'path' => 'data/mail/attachments', - 'recursive' => false, - ], - ], - ], -// options that will be used only if Laminas\Mail\Transport\Smtp adapter is used - 'smtp_options' => [ - 'host' => 'smtp.gmail.com', - 'port' => 587, - 'connection_class' => 'login', - 'connection_config' => [ - 'username' => '', - 'password' => '', - 'ssl' => 'tls', - ], - ], -// file options that will be used only if the adapter is Laminas\Mail\Transport\File -// 'file_options' => [ -// 'path' => 'data/mail/output', -// //a callable that will get the Laminas\Mail\Transport\File object as an argument -// //and should return the filename if null is used, and empty callable will be used -// 'callback' => null, -// ], -// listeners to register with the mail service, for mail events - 'event_listeners' => [ -// [ -// 'type' => 'service or class name', -// 'priority' => 1, -// ], - ], - ], -// option to log the SENT emails - 'log' => [ - 'sent' => getcwd() . '/log/mail/sent.log', - ], - /** - * You can define other mail services here, with the same structure as the default block - * you can even extend from the default block, and overwrite only the differences - */ - ], -]; From d269808c488ebd1e8aa1db2704cc61bb189f90fa Mon Sep 17 00:00:00 2001 From: MarioRadu Date: Tue, 10 Dec 2024 00:38:50 +0200 Subject: [PATCH 6/6] upgraded to dotkernel/dot-mail 5.0 Signed-off-by: MarioRadu --- config/autoload/mail.global.php.dist | 80 ++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 config/autoload/mail.global.php.dist diff --git a/config/autoload/mail.global.php.dist b/config/autoload/mail.global.php.dist new file mode 100644 index 00000000..9ef3b308 --- /dev/null +++ b/config/autoload/mail.global.php.dist @@ -0,0 +1,80 @@ + [ + //the key is the mail service name, this is the default one, which does not extend any configuration + 'default' => [ + //message configuration + 'message_options' => [ + //from email address of the email + 'from' => '', + //from name to be displayed instead of from address + 'from_name' => '', + //reply-to email address of the email + 'reply_to' => '', + //replyTo name to be displayed instead of the address + 'reply_to_name' => '', + //destination email address as string or a list of email addresses + 'to' => [], + //copy destination addresses + 'cc' => [], + //hidden copy destination addresses + 'bcc' => [], + //email subject + 'subject' => '', + //body options - content can be plain text, HTML + 'body' => [ + 'content' => '', + 'charset' => 'utf-8', + ], + //attachments config + 'attachments' => [ + 'files' => [], + 'dir' => [ + 'iterate' => false, + 'path' => 'data/mail/attachments', + 'recursive' => false, + ], + ], + ], + /** + * the mail transport to use can be any class implementing + * Symfony\Component\Mailer\Transport\TransportInterface + * + * for standard mail transports, you can use these aliases: + * - sendmail => Symfony\Component\Mailer\Transport\SendmailTransport + * - esmtp => Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport + * + * defaults to sendmail + **/ + 'transport' => 'sendmail', + //options that will be used only if esmtp adapter is used + 'smtp_options' => [ + //hostname or IP address of the mail server + 'host' => '', + //port of the mail server - 587 or 465 for secure connections + 'port' => 587, + 'connection_config' => [ + //the smtp authentication identity + 'username' => '', + //the smtp authentication credential + 'password' => '', + //to disable auto_tls set tls key to false + //it's not recommended to disable TLS while connecting to an SMTP server + 'tls' => null, + ], + ], + ], + // option to log the SENT emails + 'log' => [ + 'sent' => getcwd() . '/log/mail/sent.log', + ], + ], +];