26 lines
723 B
Plaintext
26 lines
723 B
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Install, update and uninstall functions for the contact module.
|
|
*/
|
|
|
|
use Drupal\Core\Language\Language;
|
|
|
|
/**
|
|
* Implements hook_install().
|
|
*/
|
|
function contact_install() {
|
|
$site_mail = \Drupal::config('system.site')->get('mail');
|
|
if (empty($site_mail)) {
|
|
$site_mail = ini_get('sendmail_from');
|
|
}
|
|
$config = \Drupal::config('contact.category.feedback');
|
|
// Update the recipients if the default configuration entity has been created.
|
|
// We should never rely on default config entities as during enabling a module
|
|
// during config sync they will not exist.
|
|
if (!$config->isNew()) {
|
|
\Drupal::config('contact.category.feedback')->set('recipients', array($site_mail))->save();
|
|
}
|
|
}
|