Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.89 KB | None | 0 0
  1.             $mail = drupal_mail('artdiet_iframe', 'homesplace_club_mail', $account->mail, 'he', $params);
  2.         }
  3.     }
  4.     if ($account){
  5.         _artdiet_iframe_update_user_profile($args, $account);
  6.     }
  7.   return $account;
  8. }
  9. /**
  10.  *
  11.  * Mail sent to iframe users
  12.  */
  13. function artdiet_iframe_mail($key, &$message, $params) {
  14.   $language = $message['language'];
  15.   $variables = user_mail_tokens($params['account'], $language);
  16.   $variables['!profile_link'] =  url('user/edit/user_metrics', array('absolute' => 'TRUE'));
  17.   $message['subject'] .= _artdiet_iframe_text($key .'_subject', $language, $variables);
  18.   $message['body'][] = _artdiet_iframe_text($key .'_body', $language, $variables);
  19. }
  20.  
  21. /**
  22.  * Returns a mail string for a variable name.
  23.  *
  24.  * Used by artdiet_iframe_mail() and the settings forms to retrieve strings.
  25.  * CSS tags are taken from the htmlmail module setttig page.
  26.  */
  27. function _artdiet_iframe_text($key, $language = NULL, $variables = array()) {
  28.   $langcode = isset($language) ? $language->language : NULL;
  29.   switch ($key) {
  30.     case 'homesplace_club_mail_subject':
  31.         return t('Account details for !username at !site', $variables, $langcode);
  32.     case 'homesplace_club_mail_body':
  33.         $title = '<div class="title">' . t("Hi !username\n\n", $variables, $langcode) .  '</div>' ;
  34.         return '<div class="text">'  . $title .
  35.           t("Thank you for registering at !site. You may now log in to !login_uri using the following username and password:\n\n
  36.             username: !username\n
  37.             password: !password\n\n
  38.             You may also log in by clicking on this link or copying and pasting it in your browser:\n\n
  39.             !login_url\n\n
  40.             This is a one-time login, so it can be used only once.\n\n
  41.             After logging in, you will be redirected to !edit_uri so you can change your password.\n
  42.             You may update your profile here !profile_link\n\n\n
  43.             --  !site team", $variables, $langcode) . '</div>' ;
  44.   }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement