silverstripe-cms icon indicating copy to clipboard operation
silverstripe-cms copied to clipboard

[2012-07-05] Add email address of administrator from installation to mysite/_config.php

Open silverstripe-issues opened this issue 11 years ago • 1 comments

created by: praxis created at: 2012-07-05 original ticket: http://open.silverstripe.org/ticket/7621


When trying to call Email::getAdminEmail() today I mistakenly thought it would pull the admin e-mail address from the administrator member record. Then upon reading the docs for Email I see:

/**
     * @param sring $admin_email_address The default administrator email address. 
     * This will be set in the config on a site-by-site basis
     */
    static $admin_email_address = '';

If it needs to be manually added to the config, it would be a nice simple shortcut to add the following to the generated mysite/_config.php file during installation:

Email::setAdminEmail("<FROM INSTALLER>");

silverstripe-issues avatar Apr 03 '13 20:04 silverstripe-issues

Installer should be updated to auto-configure the config as below:

---
Name: siteadmin
---
SilverStripe\Control\Email:
  admin_email: [email protected]

tractorcow avatar Nov 05 '17 22:11 tractorcow