public function DevelMailLoggerController::sendMail in Devel Mail Logger 8
Send a test mail to current user.
Return value
[type] [description]
1 string reference to 'DevelMailLoggerController::sendMail'
File
- src/
Controller/ DevelMailLoggerController.php, line 193
Class
- DevelMailLoggerController
- Class DevelMailLoggerController.
Namespace
Drupal\devel_mail_logger\ControllerCode
public function sendMail() {
$module = 'devel_mail_logger';
$key = 'send_test';
$to = \Drupal::currentUser()
->getEmail();
$params['message'] = 'body';
$params['subject'] = 'subject';
$langcode = \Drupal::currentUser()
->getPreferredLangcode();
$send = TRUE;
$result = $this->pluginManagerMail
->mail($module, $key, $to, $langcode, $params, NULL, $send);
return [
'#markup' => t('Mail sent.'),
];
}