materio_expo.module 873 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * @file
  4. * Contains materio_expo.module.
  5. */
  6. use Drupal\Core\Routing\RouteMatchInterface;
  7. /**
  8. * Implements hook_help().
  9. */
  10. function materio_expo_help($route_name, RouteMatchInterface $route_match) {
  11. switch ($route_name) {
  12. // Main module help for the materio_expo module.
  13. case 'help.page.materio_expo':
  14. $output = '';
  15. $output .= '<h3>' . t('About') . '</h3>';
  16. $output .= '<p>' . t('My Awesome Module') . '</p>';
  17. return $output;
  18. default:
  19. }
  20. }
  21. /**
  22. * Implements hook_mail().
  23. */
  24. function materio_expo_mail($key, &$message, $params) {
  25. switch ($key) {
  26. case 'expo_getmail_submitted':
  27. $message['from'] = \Drupal::config('system.site')->get('mail');
  28. $message['subject'] = t('[EXPO] mail submitted: @mail', array('@mail' => $params['email']));
  29. $message['body'][] = $params['message'];
  30. break;
  31. }
  32. }