function user_delete_mail_alter in User Delete 6.2
Implements hook_mail_alter().
We have no change to create the !cancelurl placeholder, so we need to keep track of these emails and replace that string with a valid cancellation url
File
- ./
user_delete.module, line 504 - Provide account cancellation methods and API to provide the same functionalty as Drupal 7 for cancelling accounts.
Code
function user_delete_mail_alter(&$message) {
if ($message['id'] == 'user_cancel_confirm') {
$user_cancel_url = user_delete_cancel_url($message['params']['account']);
if (is_array($message['body'])) {
foreach ($message['body'] as $id => $content) {
$message['body'][$id] = str_replace('!cancelurl', $user_cancel_url, $message['body'][$id]);
}
}
else {
// Some modules use the body as a string, erroneously.
$message['body'][$id] = str_replace('!cancelurl', user_delete_cancel_url($message['params']['account']), $message['body']);
}
}
}