Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

User tools behaviour config email #48

Open
webdevzone opened this issue Jul 24, 2018 · 1 comment
Open

User tools behaviour config email #48

webdevzone opened this issue Jul 24, 2018 · 1 comment
Labels

Comments

@webdevzone
Copy link

I have problem with setting up email.
I used in my bootstrap:

Configure::write('UserTools.Behavior', [
    'emailConfig' => 'mailhog'
]);

my email settings in config/app.php are:

'EmailTransport' => [
        'default' => [
            'className' => 'Cake\Mailer\Transport\MailTransport',
            /*
             * The following keys are used in SMTP transports:
             */
            'host' => 'localhost',
            'port' => 25,
            'timeout' => 30,
            'username' => null,
            'password' => null,
            'client' => null,
            'tls' => null,
            'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
        ],
        'mailhog' => [
            # These are default settings for the MailHog container - make sure it's running first
            'className' => 'Smtp',
            'host' => 'myapp-mailhog',
            'port' => 1025,
            'timeout' => 30,
        ],
    ],

/**
     * Email delivery profiles
     */
    'Email' => [
        'default' => [
            'transport' => 'default',
            'from' => 'martin@devzone.es',
            'charset' => 'utf-8',
            'headerCharset' => 'utf-8',
        ],
        'mailhog' => [
            'transport' => 'mailhog',
            'from' => 'martin@devzone.es',
            'charset' => 'utf-8',
            'headerCharset' => 'utf-8',
        ]
    ],

when i use user registration form it ends with Cake Exception

Could not send email: unknown
Cake\Network\Exception\SocketException

however when i change in my email delivery in default profile the "transport" from "default" to "mailhog" all works fine.

it seems that the behavior config

Configure::write('UserTools.Behavior', [
    'emailConfig' => 'mailhog'
]);

is ignored an using always default profile.

Or am i doing something wrong with the UserTools.Behaviour config ?

@burzum
Copy link
Owner

burzum commented Sep 21, 2018

No, this should work.

@burzum burzum added the bug label Sep 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants