Changeset 1645


Ignore:
Timestamp:
Dec 9, 2006, 1:43:23 AM (17 years ago)
Author:
rub
Message:

Feature Issue ID 0000598:

Possibility to send HTML mail

Optimize, fix little bugs and add footer information

NBM: Replace by / on subscribe/unsubscribe link

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_notification_by_mail.inc.php

    r1531 r1645  
    325325 
    326326  $content .= "___________________________________________________\n\n";
    327   $content .= sprintf(l10n('nbm_content_unsubscribe_link'), add_url_params(get_root_url().'/nbm.php', array('unsubscribe' => $nbm_user['check_key'])))."\n";
    328   $content .= sprintf(l10n('nbm_content_subscribe_link'), add_url_params(get_root_url().'/nbm.php', array('subscribe' => $nbm_user['check_key'])))."\n";
     327  $content .= sprintf(l10n('nbm_content_unsubscribe_link'), add_url_params(get_root_url().'nbm.php', array('unsubscribe' => $nbm_user['check_key'])))."\n";
     328  $content .= sprintf(l10n('nbm_content_subscribe_link'), add_url_params(get_root_url().'nbm.php', array('subscribe' => $nbm_user['check_key'])))."\n";
    329329  $content .= sprintf(l10n('nbm_content_subscribe_unsubscribe_contact'), $env_nbm['send_as_mail_address'])."\n";
    330330  $content .= "___________________________________________________\n\n\n\n";
  • trunk/include/functions_mail.inc.php

    r1644 r1645  
    102102
    103103/**
     104 * Returns an new mail template
     105 *
     106 * @param none
     107 */
     108function get_mail_template()
     109{
     110  global $conf;
     111
     112  // for mail, default template are used
     113  list($tmpl, $thm) = explode('/', $conf['default_template']);
     114  $mail_template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm);
     115
     116  return $mail_template;
     117}
     118
     119/**
    104120 * sends an email, using PhpWebGallery specific informations
    105121 */
     
    147163  }
    148164
    149   list($tmpl, $thm) = explode('/', $conf['default_template']);
    150 
    151165  $content = '';
    152166
    153   if ($email_format == 'text/html')
    154   {
    155     $template_mail = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm);
    156 
    157     $template_mail->set_filenames(array('mail_header'=>'mail/header.tpl'));
    158 
    159     $template_mail->assign_vars(
    160       array(
    161         'BODY_ID' =>
    162           isset($page['body_id']) ?
    163             $page['body_id'] : '',
    164 
    165         'CONTENT_ENCODING' => $lang_info['charset'],
    166         'LANG'=>$lang_info['code'],
    167         'DIR'=>$lang_info['direction']
    168 
    169         ));
    170 
    171     $content.= $template_mail->parse('mail_header', true);
    172   }
     167  if (!isset($conf_mail[$email_format][$lang_info['charset']]['header']))
     168  {
     169    if ($email_format == 'text/html')
     170    {
     171      $mail_template = get_mail_template();
     172
     173      $mail_template->set_filenames(array('mail_header'=>'mail/header.tpl'));
     174
     175      $mail_template->assign_vars(
     176        array(
     177          'BODY_ID' =>
     178            isset($page['body_id']) ?
     179              $page['body_id'] : '',
     180
     181          'CONTENT_ENCODING' => $lang_info['charset'],
     182          'LANG'=>$lang_info['code'],
     183          'DIR'=>$lang_info['direction']
     184
     185          ));
     186
     187      $conf_mail[$email_format][$lang_info['charset']]['header'] =
     188        $mail_template->parse('mail_header', true);
     189    }
     190    else
     191    {
     192      $conf_mail[$email_format][$lang_info['charset']]['header'] = '';
     193    }
     194  }
     195
     196  $content.= $conf_mail[$email_format][$lang_info['charset']]['header'];
    173197
    174198  if (($format_infos == 'text/plain') and ($email_format == 'text/html'))
     
    181205  }
    182206
    183   if ($email_format == 'text/plain')
    184   {
    185     $content.= $conf_mail['text_footer'];
    186   }
    187   else
    188   {
    189     $template_mail->set_filenames(array('mail_footer'=>'footer.tpl'));
    190 
    191     $template_mail->assign_vars(
    192       array(
    193         'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
    194 
    195         'L_TITLE_MAIL' => urlencode(l10n('title_send_mail')),
    196         'MAIL' => get_webmaster_mail_address()
    197         ));
    198 
    199     $content.= $template_mail->parse('mail_footer', true);
    200   }
     207  if (!isset($conf_mail[$email_format][$lang_info['charset']]['footer']))
     208  {
     209    if ($email_format == 'text/html')
     210    {
     211      $mail_template->set_filenames(array('mail_footer'=>'mail/footer.tpl'));
     212
     213      $mail_template->assign_vars(
     214        array(
     215          'GALLERY_URL' =>
     216            isset($page['gallery_url']) ?
     217                  $page['gallery_url'] : $conf['gallery_url'],
     218          'GALLERY_TITLE' =>
     219            isset($page['gallery_title']) ?
     220                  $page['gallery_title'] : $conf['gallery_title'],
     221          'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
     222
     223          'L_TITLE_MAIL' => urlencode(l10n('title_send_mail')),
     224          'MAIL' => get_webmaster_mail_address()
     225          ));
     226
     227      $conf_mail[$email_format][$lang_info['charset']]['footer'] =
     228        $mail_template->parse('mail_footer', true);
     229    }
     230    else
     231    {
     232      $conf_mail[$email_format][$lang_info['charset']]['footer'] = $conf_mail['text_footer'];
     233    }
     234  }
     235
     236  $content.= $conf_mail[$email_format][$lang_info['charset']]['footer'];
    201237
    202238  if ($conf_mail['mail_options'])
  • trunk/template/yoga/mail/footer.tpl

    r1642 r1645  
    55          to show the origin of the script...-->
    66
     7  <a href="{GALLERY_URL}" class="back">{GALLERY_TITLE}</a> -
    78  {lang:powered_by} <a href="http://www.phpwebgallery.net" class="back">PhpWebGallery</a>
    89  {VERSION}
    910  - {lang:send_mail}
    10   <a href="mailto:{contact.MAIL}?subject={L_TITLE_MAIL}">{lang:Webmaster}</a>
     11  <a href="mailto:{MAIL}?subject={L_TITLE_MAIL}">{lang:Webmaster}</a>
    1112
    1213</div> <!-- copyright -->
Note: See TracChangeset for help on using the changeset viewer.