aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_mail.inc.php46
1 files changed, 26 insertions, 20 deletions
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index 98f5b5a1d..68df98e10 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -206,30 +206,36 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $for
'MAIL' => get_webmaster_mail_address()
));
- $mail_template->set_filename('mail_css_default_template', 'default-layout-mail-css.tpl');
- $mail_template->assign_var_from_handle('MAIL_CSS_DEFAULT_TEMPLATE', 'mail_css_default_template');
+ if ($email_format == 'text/html')
+ {
+ if (is_file($mail_template->root.'/default-layout-mail-css.tpl'))
+ {
+ $mail_template->set_filename('mail_css_default_template', 'default-layout-mail-css.tpl');
+ $mail_template->assign_var_from_handle('MAIL_CSS_DEFAULT_TEMPLATE', 'mail_css_default_template');
+ }
- $old_root = $mail_template->root;
+ $old_root = $mail_template->root;
- $mail_template->root = PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/'.$user['theme'];
- if (is_file($mail_template->root.'/layout-mail-css.tpl'))
- {
- $mail_template->set_filename('mail_css_theme', 'layout-mail-css.tpl');
- $mail_template->assign_var_from_handle('MAIL_CSS_THEME', 'mail_css_theme');
- }
+ $mail_template->root = PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/'.$user['theme'];
+ if (is_file($mail_template->root.'/layout-mail-css.tpl'))
+ {
+ $mail_template->set_filename('mail_css_theme', 'layout-mail-css.tpl');
+ $mail_template->assign_var_from_handle('MAIL_CSS_THEME', 'mail_css_theme');
+ }
- $mail_template->root = PHPWG_ROOT_PATH.'template-common';
- if (is_file($mail_template->root.'/local-layout-mail-css.tpl'))
- {
- $mail_template->set_filename('mail_css_local_template', 'local-layout-mail-css.tpl');
- $mail_template->assign_var_from_handle('MAIL_CSS_LOCAL_COMMON', 'mail_css_local_template');
- }
+ $mail_template->root = PHPWG_ROOT_PATH.'template-common';
+ if (is_file($mail_template->root.'/local-layout-mail-css.tpl'))
+ {
+ $mail_template->set_filename('mail_css_local_template', 'local-layout-mail-css.tpl');
+ $mail_template->assign_var_from_handle('MAIL_CSS_LOCAL_COMMON', 'mail_css_local_template');
+ }
- $mail_template->root = $old_root;
- if (is_file($mail_template->root.'/local-layout-mail-css.tpl'))
- {
- $mail_template->set_filename('mail_css_local_template', 'local-layout-mail-css.tpl');
- $mail_template->assign_var_from_handle('MAIL_CSS_LOCAL_TEMPLATE', 'mail_css_local_template');
+ $mail_template->root = $old_root;
+ if (is_file($mail_template->root.'/local-layout-mail-css.tpl'))
+ {
+ $mail_template->set_filename('mail_css_local_template', 'local-layout-mail-css.tpl');
+ $mail_template->assign_var_from_handle('MAIL_CSS_LOCAL_TEMPLATE', 'mail_css_local_template');
+ }
}
// what are displayed on the header of each mail ?