In my module I want to get the site wide email address - the one that is set in the site information admin pages and that is used for all automatically send email messages.
How can I do this?
In my module I want to get the site wide email address - the one that is set in the site information admin pages and that is used for all automatically send email messages.
How can I do this?
You can preprocess the variable like -
function hook_preprocess(&$variables, $hook) {
$variables['site_email'] = \Drupal::config('system.site')->get('mail');
//kint( $variables['site_email']);
}
then use $variables['site_email'] anywhere to get the system wide email.