function basic_cart_mail in Basic cart 8.2
Same name and namespace in other branches
- 8.6 basic_cart.module \basic_cart_mail()
- 8 basic_cart.module \basic_cart_mail()
- 8.0 basic_cart.module \basic_cart_mail()
- 8.3 basic_cart.module \basic_cart_mail()
- 8.4 basic_cart.module \basic_cart_mail()
- 8.5 basic_cart.module \basic_cart_mail()
- 7 basic_cart.cart.inc \basic_cart_mail()
- 7.2 basic_cart.cart.inc \basic_cart_mail()
Implements hook_mail().
File
- ./
basic_cart.module, line 142 - Basic cart module file.
Code
function basic_cart_mail($key, &$message, $params) {
$utility = new Utility();
$config = $utility
->checkoutSettings();
$options = array(
'langcode' => $message['langcode'],
);
$message['from'] = \Drupal::config('system.site')
->get('mail');
switch ($key) {
case 'admin_mail':
$message['subject'] = SafeMarkup::checkPlain($config
->get('admin')['subject']);
$message['body'][] = Xss::filter($params['admin_message']);
break;
case 'user_mail':
$message['subject'] = SafeMarkup::checkPlain($config
->get('user')['subject']);
$message['body'][] = Xss::filter($params['user_message']);
break;
}
}