silverstripe-cms
silverstripe-cms copied to clipboard
[2012-07-05] Add email address of administrator from installation to mysite/_config.php
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>");
Installer should be updated to auto-configure the config as below:
---
Name: siteadmin
---
SilverStripe\Control\Email:
admin_email: [email protected]