Closed ghost closed 5 years ago
I’m not able to reproduce this, but pretty sure I’ve fixed it for the next release.
@brandonkelly Thanks, after applying this patch manually (beta-2, solo) i could save and successfully deploy again, excerpt of project.yaml:
email:
fromEmail: admin@craft2.local
fromName: Craft2
template: null
transportSettings:
encryptionMethod: tls
host: smtp.mailtrap.io
password: $SMTP_PASSWORD
port: $SMTP_PORT
timeout: '10'
useAuthentication: '1'
username: $SMTP_USER
transportType: craft\mail\transportadapters\Smtp
Two things:
Clicking 'Test' results in:
Argument 1 passed to Craft::parseEnv() must be of the type string, null given, called in E:\craft\craft4\vendor\craftcms\cms\src\helpers\App.php on line 401
Line 401 refers to $settings->template, so it is obviously the template:null line above. Same with sending password reset mail.
I could save environment variables in smtp user/port (no autocompletion here?)/password, but when trying to enter $SMTP_HOST (selected from autocomplete) in the host field, it results in
Argument 1 passed to craft\helpers\StringHelper::ensureRight() must be of the type string, null given, called in E:\craft\craft2\vendor\craftcms\cms\src\behaviors\EnvAttributeParserBehavior.php on line 85
Thanks again for your great work!
Alright, hopefully those will be fixed for you as well now. Still not able to reproduce though. Even if I leave those settings blank, they hit the server as empty strings, not null
.
@brandonkelly Yes, that seems to work now. Thanks again.
One last remark: Obviously you can't set the smtp port via an environment variable, which is fine in our current environment using mailtrap.io for testing, but i'm quite sure that will not be always the case.
Description
When trying to save Email settings with Type:SMTP there is an error:
Argument 1 passed to Craft::parseEnv() must be of the type string, null given, called in ...\vendor\craftcms\cms\src\behaviors\EnvAttributeParserBehavior.php on line 75
Steps to reproduce
Additional info
Thanks.