You are here

function basic_cart_mail in Basic cart 8

Same name and namespace in other branches
  1. 8.6 basic_cart.module \basic_cart_mail()
  2. 8.0 basic_cart.module \basic_cart_mail()
  3. 8.2 basic_cart.module \basic_cart_mail()
  4. 8.3 basic_cart.module \basic_cart_mail()
  5. 8.4 basic_cart.module \basic_cart_mail()
  6. 8.5 basic_cart.module \basic_cart_mail()
  7. 7 basic_cart.cart.inc \basic_cart_mail()
  8. 7.2 basic_cart.cart.inc \basic_cart_mail()

Implements hook_mail().

File

./basic_cart.module, line 142

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;
  }
}