function user_update_8100 in Drupal 8
Fix invalid token in the status_blocked email body.
File
- core/
modules/ user/ user.install, line 97 - Install, update and uninstall functions for the user module.
Code
function user_update_8100() {
$config_factory = \Drupal::configFactory();
$config = $config_factory
->getEditable('user.mail');
$mail = $config
->get('status_blocked');
if (strpos($mail['body'], '[site:account-name]') !== FALSE) {
$mail['body'] = str_replace('[site:account-name]', '[site:name]', $mail['body']);
$config
->set('status_blocked', $mail)
->save(TRUE);
}
}