forked from projectsend/projectsend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemail-preview.php
76 lines (63 loc) · 1.54 KB
/
email-preview.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* Show a preview of the currently selected e-mail template
*
* @package ProjectSend
* @subpackage Options
*/
$allowed_levels = array(9);
require_once('sys.includes.php');
$page_title = __('E-mail templates','cftp_admin') . ': ' . __('Preview','cftp_admin');
$active_nav = 'options';
/** Do a couple of functions that are in header.php */
/** Check for an active session or cookie */
check_for_session();
can_see_content($allowed_levels);
$database->MySQLDB();
/** Get the default header and footer */
include_once(ROOT_DIR.'/includes/email-template.php');
global $email_template_header;
global $email_template_footer;
/** Get the preview type */
$type = $_GET['t'];
switch ($type) {
case 'client_by_user':
$body_text = EMAILS_CLIENT_BY_USER_TEXT;
break;
case 'client_by_self':
$body_text = EMAILS_CLIENT_BY_SELF_TEXT;
break;
case 'new_user_welcome':
$body_text = EMAILS_NEW_USER_TEXT;
break;
case 'file_by_user':
$body_text = EMAILS_FILE_BY_USER_TEXT;
break;
case 'file_by_client':
$body_text = EMAILS_FILE_BY_CLIENT_TEXT;
break;
case 'password_reset':
$body_text = EMAILS_PASS_RESET_TEXT;
break;
}
/**
* Header
*/
if (!defined('EMAILS_HEADER_FOOTER_CUSTOM') || EMAILS_HEADER_FOOTER_CUSTOM == '0') {
$header = $email_template_header;
}
else {
$header = EMAILS_HEADER_TEXT;
}
/**
* Footer
*/
if (!defined('EMAILS_HEADER_FOOTER_CUSTOM') || EMAILS_HEADER_FOOTER_CUSTOM == '0') {
$footer = $email_template_footer;
}
else {
$footer = EMAILS_FOOTER_TEXT;
}
echo $header . $body_text . $footer;
ob_end_flush();
?>