Skip to content

Commit 29928c7

Browse files
committed
up to date
Signed-off-by: sergiu <sergiubota@rospace.com>
2 parents a1e580b + 971c15f commit 29928c7

File tree

8 files changed

+130
-10
lines changed

8 files changed

+130
-10
lines changed

.github/workflows/codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
php:
1818
- "8.2"
1919
- "8.3"
20+
- "8.4"
2021

2122
steps:
2223
- name: Checkout

.laminas-ci.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"ignore_php_platform_requirements": {
3-
"8.4": true
4-
},
52
"backwardCompatibilityCheck": true
63
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
## dot-mail badges
77

88
![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-mail)
9-
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-mail/5.0.0)
9+
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-mail/5.2.1)
1010

1111
[![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-mail)](https://github.com/dotkernel/dot-mail/issues)
1212
[![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-mail)](https://github.com/dotkernel/dot-mail/network)

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
3131
"ext-fileinfo": "*",
3232
"ext-json": "*",
33-
"laminas/laminas-servicemanager": "^3.22",
34-
"dotkernel/dot-event": "^3.4",
33+
"dotkernel/dot-event": "^4.0",
34+
"laminas/laminas-servicemanager": "^3.22 || ^4.0",
3535
"symfony/mailer": "v7.1.6"
3636
},
3737
"require-dev": {
3838
"laminas/laminas-coding-standard": "^3.0",
3939
"mikey179/vfsstream": "^v1.6.11",
4040
"phpunit/phpunit": "^10.5",
41-
"vimeo/psalm": "^5.23"
41+
"vimeo/psalm": "^6.0"
4242
},
4343
"autoload": {
4444
"psr-4": {
@@ -53,7 +53,8 @@
5353
"scripts": {
5454
"check": [
5555
"@cs-check",
56-
"@test"
56+
"@test",
57+
"@static-analysis"
5758
],
5859
"cs-check": "phpcs",
5960
"cs-fix": "phpcbf",

docs/book/v4/configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Register `dot-mail` in you project by adding `Dot\Mail\ConfigProvider::class` to your configuration aggregator (to `config/config.php` for example).
44
After registering the `ConfigProvider` copy the configuration file `config/mail.global.php.dist` into your project's `config/autoload/` directory as `mail.global.php`.
55

6-
The resulting `mail.global.php` contains the necessary configurations for all available transport types, message options and logging options in one place. The config file provides a set of default values available to all mails under the `dot-mail.default` key.
6+
The resulting `mail.global.php` contains the necessary configurations for all available transport types, message options and logging options in one place.
7+
The config file provides a set of default values available to all mails under the `dot-mail.default` key.
78

89
Many of these options can be programmatically set when sending the actual email.
910

docs/book/v5/configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Register `dot-mail` in you project by adding `Dot\Mail\ConfigProvider::class` to your configuration aggregator (to `config/config.php` for example).
44
After registering the `ConfigProvider` copy the configuration file `config/mail.global.php.dist` into your project's `config/autoload/` directory as `mail.global.php`.
55

6-
The resulting `mail.global.php` contains the necessary configurations for all available transport types, message options and logging options in one place. The config file provides a set of default values available to all mails under the `dot-mail.default` key.
6+
The resulting `mail.global.php` contains the necessary configurations for all available transport types, message options and logging options in one place.
7+
The config file provides a set of default values available to all mails under the `dot-mail.default` key.
78

89
Many of these options can be programmatically set when sending the actual email.
910

docs/book/v5/upgrade-v4-to-v5.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# How to update `dotkernel/dot-mail` from v3/v4 to v5 in your projects
2+
3+
- The first thing to do is download the new [mail configuration file](https://github.com/dotkernel/dot-mail/blob/5.0/config/mail.global.php.dist).
4+
- Add the values you configured for your project, focusing on `transport`, `message_options` and `smtp_options`, then replace your old configuration file.
5+
- In your `composer.json` update `"dotkernel/dot-mail": "^5.0.0",` and run `composer update` in the command line.
6+
7+
At this moment, `mime` and `imap` related functionality is removed.
8+
9+
## Technical approach
10+
11+
You can follow all the changes in this list of PRs:
12+
13+
- [dot-mail PR 65](https://github.com/dotkernel/dot-mail/pull/65/files)
14+
- [dot-mail PR 66](https://github.com/dotkernel/dot-mail/pull/66/files)
15+
- [dot-mail PR 67](https://github.com/dotkernel/dot-mail/pull/67/files)
16+
- [dot-mail PR 69](https://github.com/dotkernel/dot-mail/pull/69/files)
17+
18+
> Function definition changes will not be covered in this article.
19+
20+
When upgrading dotkernel/dot-mail from v4 to v5, the main focus is on the configuration file `mail.global.php`.
21+
It was revised to implement symfony/mailer, to remove features that are no longer available and to make dotkernel/dot-mail easier to configure.
22+
23+
```php
24+
?php
25+
26+
declare(strict_types=1);
27+
28+
return [
29+
/**
30+
* Dotkernel mail module configuration
31+
* Note that many of these options can be set programmatically too, when sending mail messages actually that is
32+
* what you'll usually do, these configs provide just defaults and options that remain the same for all mails
33+
*/
34+
'dot_mail' => [
35+
//the key is the mail service name, this is the default one, which does not extend any configuration
36+
'default' => [
37+
//message configuration
38+
'message_options' => [
39+
//from email address of the email
40+
'from' => '',
41+
//from name to be displayed instead of from address
42+
'from_name' => '',
43+
//reply-to email address of the email
44+
'reply_to' => '',
45+
//replyTo name to be displayed instead of the address
46+
'reply_to_name' => '',
47+
//destination email address as string or a list of email addresses
48+
'to' => [],
49+
//copy destination addresses
50+
'cc' => [],
51+
//hidden copy destination addresses
52+
'bcc' => [],
53+
//email subject
54+
'subject' => '',
55+
//body options - content can be plain text, HTML
56+
'body' => [
57+
'content' => '',
58+
'charset' => 'utf-8',
59+
],
60+
//attachments config
61+
'attachments' => [
62+
'files' => [],
63+
'dir' => [
64+
'iterate' => false,
65+
'path' => 'data/mail/attachments',
66+
'recursive' => false,
67+
],
68+
],
69+
],
70+
/**
71+
* the mail transport to use can be any class implementing
72+
* Symfony\Component\Mailer\Transport\TransportInterface
73+
*
74+
* for standard mail transports, you can use these aliases:
75+
* - sendmail => Symfony\Component\Mailer\Transport\SendmailTransport
76+
* - esmtp => Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport
77+
*
78+
* defaults to sendmail
79+
**/
80+
'transport' => 'sendmail',
81+
//options that will be used only if esmtp adapter is used
82+
'smtp_options' => [
83+
//hostname or IP address of the mail server
84+
'host' => '',
85+
//port of the mail server - 587 or 465 for secure connections
86+
'port' => 587,
87+
'connection_config' => [
88+
//the smtp authentication identity
89+
'username' => '',
90+
//the smtp authentication credential
91+
'password' => '',
92+
//to disable auto_tls set tls key to false
93+
//it's not recommended to disable TLS while connecting to an SMTP server
94+
'tls' => null,
95+
],
96+
],
97+
],
98+
// option to log the SENT emails
99+
'log' => [
100+
'sent' => getcwd() . '/log/mail/sent.log',
101+
],
102+
],
103+
];
104+
```
105+
106+
Make sure to use **ONE** of the below transporters, based on your server configuration.
107+
108+
```php
109+
'transport' => 'sendmail',
110+
```
111+
112+
OR
113+
114+
```php
115+
'transport' => 'esmtp',
116+
```
117+
118+
We set **Sendmail** to be the default.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ nav:
2020
- Configuration: v5/configuration.md
2121
- Usage: v5/usage.md
2222
- Transports: v5/transports.md
23+
- Upgrade from V4 to v5: v5/upgrade-v4-to-v5.md
2324
site_name: dot-mail
2425
site_description: "Dotkernel's mail service"
2526
repo_url: "https://github.com/dotkernel/dot-mail"

0 commit comments

Comments
 (0)