forked from wordpressecommerce/woocommerce-email-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
email-testing.php
106 lines (83 loc) · 4.06 KB
/
email-testing.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<style type="text/css" media="screen">
.testing{clear: both; height: 60px; margin: 6px 0 4px; vertical-align: middle;}
.testing select, .testing input[type="text"]{ height: 32px; min-width: 180px;}
.nolabel input[type="submit"], .nolabel button{height: 32px !important; margin-top: 20px !important;}
.alignleft{text-align: left;}
.actions{padding: 2px 8px 0 0;}
</style>
<div class="wrap">
<h1 class="wp-heading-inline">Email Testing
<!-- <span class="title-count">20</span> -->
</h1>
<a href="https://github.com/ThemesEmail/woocommerce-email-testing" target="_blank" class="page-title-action">Learn More</a>
<hr class="wp-header-end">
<br class="clear">
<div class="update-nag notice notice-success is-dismissible">
<p><strong>Looking for the store emails settings? It can now be found in the section <a href="/wp-admin/admin.php?page=wc-settings&tab=email">Settings > Emails</a>.</strong></p>
</div>
<div class="theme-browser rendered">
<?php
// update options if POST
wet_update_testing_email_options();
// get option values
$testing_email_options = wet_get_testing_email_options();
?>
<h3>Settings</h3>
<form method="post" action="">
<div class="testing">
<div class="alignleft actions">
<label for="wc_email_testing_email"><strong>Email</strong> (where to send)</label>
<br/>
<input id="wc_email_testing_email" type="text" value="<?php echo $testing_email_options['wc_email_testing_email']; ?>" name="wc_email_testing_email">
</div>
<div class="alignleft actions">
<label for="wc_email_testing_order_id"><strong>Orders</strong> (what to send)</label>
<br/>
<?php echo $order_id_select = wet_get_order_id_select_field( $testing_email_options['wc_email_testing_order_id'] ); ?>
</div>
<?php wp_nonce_field( 'wet_update_form', 'nonce' ); ?>
<div class="alignleft actions nolabel">
<input id="submit" class="button action" type="submit" value="Save" name="submit">
</div>
</div>
</form>
<hr/>
<h3>Testing</h3>
<p>for WooCommerce emails.</p>
<form method="post" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>">
<div class="testing">
<div class="alignleft actions">
<label for="EmailSelectId"><strong>Select Email</strong></label>
<br/>
<select id="EmailSelectId" name="EmailSelect">
<?php
global $wet_testing_email_class, $wet_testing_email_class_additional;
$site_url = site_url();
// WC Emails
foreach($wet_testing_email_class as $class=>$name){
?>
<option value="<?php echo $class; ?>"><?php echo $name; ?></option>
<?php
}
// WC Additional Emails
foreach($wet_testing_email_class_additional as $class=>$name){
?>
<option value="<?php echo $class; ?>"><?php echo $name; ?></option>
<?php
}
?>
</select>
</div>
<div class="alignleft actions nolabel">
<button class="button action" type="submit" name="action" value="wet_email_preview">Preview Email</button>
<button class="button button-primary action" type="submit" formaction="<?php echo esc_url( admin_url('admin-post.php') ); ?>" name="action" value="wet_email_send">Send Email</button>
</div>
</div>
</form>
</div>
</div>