You are here

function makemeeting_mail in Make Meeting Scheduler 6

Same name and namespace in other branches
  1. 7 makemeeting.module \makemeeting_mail()

hook_mail implementation

File

./makemeeting.module, line 688
Make Meeting module

Code

function makemeeting_mail($key, &$message, $params) {
  $language = $message['language'];
  switch ($key) {

    // send to friends the poll link
    case 'refer':
      $variables = array(
        '!site' => variable_get('site_name', 'Drupal'),
        '!nickname' => $params['name'],
        '!poll_owner' => $params['owner_name'],
        '!poll_link' => url('makemeeting/' . $params['poll_url'], array(
          "absolute" => TRUE,
        )),
      );
      $message['subject'] = t('Please vote at !site', $variables, $language->language);
      $message['body'] = t('Dear !nickname,

please follow the link below to answer the question of !poll_owner.

!poll_link

Greetings,
!site', $variables, $language->language);
      break;

    // send notify to poll owner
    case 'new_vote':
      $variables = array(
        '!name' => $params['name'],
        '!site' => variable_get('site_name', 'Drupal'),
        '!poll_link' => url('makemeeting/' . $params['poll_url'], array(
          "absolute" => TRUE,
        )),
      );
      $message['subject'] = t('New vote on !site', $variables, $language->language);
      $message['body'] = t('Dear !name,

somebody voted on your poll!
Check it at the following link:

!poll_link', $variables, $language->language);
      break;
    case 'create_new_poll':
      $variables = array(
        '!name' => $params['name'],
        '!site' => variable_get('site_name', 'Drupal'),
        '!poll_link' => url('makemeeting/' . $params['poll_url'], array(
          "absolute" => TRUE,
        )),
        '!admin_link' => url('makemeeting/' . $params['admin_url'], array(
          "absolute" => TRUE,
        )),
      );
      $message['subject'] = t('Created new poll');
      $message['body'] = t("Dear !name,\n\nYour poll was successfully created!\nYour poll's links are the following:\n\nPoll link: !poll_link\nAdmin link: !admin_link", $variables, $language->language);
      break;
  }
}