Skip to content

Commit

Permalink
implemented dotkernel/dot-mail 5.0
Browse files Browse the repository at this point in the history
Signed-off-by: MarioRadu <[email protected]>
  • Loading branch information
MarioRadu committed Dec 9, 2024
1 parent 922ae5a commit b0512fc
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 58 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dotkernel/dot-flashmessenger": "^3.4.2",
"dotkernel/dot-geoip": "^3.6.0",
"dotkernel/dot-helpers": "^3.4.2",
"dotkernel/dot-mail": "^4.1.1",
"dotkernel/dot-mail": "^5.1.0",
"dotkernel/dot-navigation": "^3.4.2",
"dotkernel/dot-rbac-guard": "^3.4.2",
"dotkernel/dot-session": "^5.6.0",
Expand Down
102 changes: 45 additions & 57 deletions config/autoload/mail.local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,38 @@ declare(strict_types=1);

return [
/**
* Dk mail module configuration
* Note that many of these options can be set programmatically too,
* when sending mail messages actually that is what you'll usually do,
* these configs provide just default and options that remain the same for all mails
* Dotkernel mail module configuration
* Note that many of these options can be set programmatically too, when sending mail messages actually that is
* what you'll usually do, these configs provide just defaults and options that remain the same for all mails
*/
'dot_mail' => [
// the key is the mail service name, this is the default one, which does not extend any configuration
//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' => Laminas\Mail\Transport\Sendmail::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 configuration
'message_options' => [
'from' => '',
'from_name' => 'Dotkernel',
'reply_to' => '',
//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' => '',
'to' => [],
'cc' => [],
'bcc' => [],
'subject' => '',
'body' => [
//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' => [
//attachments config
'attachments' => [
'files' => [],
'dir' => [
'iterate' => false,
Expand All @@ -53,40 +44,37 @@ return [
],
],
],
// options that will be used only if Laminas\Mail\Transport\Smtp adapter is used
/**
* 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' => [
'host' => '',
//hostname or IP address of the mail server
'host' => '',
//port of the mail server - 587 or 465 for secure connections
'port' => 587,
'connection_class' => 'login',
'connection_config' => [
//the smtp authentication identity
'username' => '',
//the smtp authentication credential
'password' => '',
'ssl' => 'ssl',
//to disable auto_tls set tls key to false
//it's not recommended to disable TLS while connecting to an SMTP server
'tls' => null,
],
],
// 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
// 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
*/
],
];

0 comments on commit b0512fc

Please sign in to comment.