Welcome Guest, Not a member yet? Register   Sign In
Module's array config in ENV does not work
#2

Found the Solution:
Solution is to define your array in config.
PHP Code:
<?php namespace Emails\Config;

use 
CodeIgniter\Config\BaseConfig;

class 
Email extends BaseConfig
{

    public $sendTo;
    
    
public $settings = [
        'protocol' => '',
        'SMTPHost' => '',
        'SMTPPort' => '',
        'SMTPUser' => '',
        'SMTPPass' => '',
        'SMTPCrypto' => '',
        'charset' => 'utf-8',
        'mailType' => 'html',
        'wordWrap' => true,
        'newline' => "\r\n",
        'CRLF' => "\r\n",
    ];

and in .env file you can do
Code:
#-- Email --
Emails\Config\Email.settings.protocol = 'smtp'
Emails\Config\Email.settings.SMTPHost = 'smtp.example.com'
Emails\Config\Email.settings.SMTPPort = '123'
Emails\Config\Email.settings.SMTPUser = 'USER'
Emails\Config\Email.settings.SMTPPass = 'PASSWORD'
Emails\Config\Email.settings.SMTPCrypto = 'ssl'
Emails\Config\Email.sendTo = '[email protected]'

THIS WORKED !!!
Reply


Messages In This Thread
RE: Module's array config in ENV does not work - by harpreetsb - 05-12-2020, 03:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB