PluginProbe
Welcart e-Commerce / 2.12.4
Welcart e-Commerce v2.12.4
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
← All changes | includes/admin_mail.php +1125 -361 1.3.22.12.4 View file →
@@ -1,361 +1,1125 @@
1 -<?php
2 -$status = $this->action_status;
3 -$message = $this->action_message;
4 -$this->action_status = 'none';
5 -$this->action_message = '';
6 -$mail_datas = $this->options['mail_data'];
7 -$smtp_hostname = $this->options['smtp_hostname'];
8 -$newmem_admin_mail = $this->options['newmem_admin_mail'];
9 -?>
10 -<script type="text/javascript">
11 -jQuery(function($){
12 -<?php if($status == 'success'){ ?>
13 - $("#anibox").animate({ backgroundColor: "#ECFFFF" }, 2000);
14 -<?php }else if($status == 'caution'){ ?>
15 - $("#anibox").animate({ backgroundColor: "#FFF5CE" }, 2000);
16 -<?php }else if($status == 'error'){ ?>
17 - $("#anibox").animate({ backgroundColor: "#FFE6E6" }, 2000);
18 -<?php } ?>
19 -
20 - $("#aAdditionalURLs").click(function () {
21 - $("#AdditionalURLs").toggle();
22 - });
23 -});
24 -
25 -function toggleVisibility(id) {
26 - var e = document.getElementById(id);
27 - if(e.style.display == 'block')
28 - e.style.display = 'none';
29 - else
30 - e.style.display = 'block';
31 -}
32 -</script>
33 -<div class="wrap">
34 -<div class="usces_admin">
35 -<h2>Welcart Shop <?php _e('E-mail Setting','usces'); ?></h2>
36 -<div id="aniboxStatus" class="<?php echo $status; ?>">
37 - <div id="anibox" class="clearfix">
38 - <img src="<?php echo USCES_PLUGIN_URL; ?>/images/list_message_<?php echo $status; ?>.gif" />
39 - <div class="mes" id="info_massage"><?php echo $message; ?></div>
40 - </div>
41 -</div>
42 -<form action="" method="post" name="option_form" id="option_form">
43 -<input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" />
44 -<div id="poststuff" class="metabox-holder">
45 -
46 -<div class="postbox">
47 -<h3 class="hndle"><span><?php _e('SMTP server host','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_smtp_host');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
48 -<div class="inside">
49 -<table class="form_table">
50 - <tr>
51 - <th width="150"><?php _e('Host name','usces'); ?></th>
52 - <td><input name="smtp_hostname" id="smtp_hostname" type="text" class="mail_title" value="<?php echo $smtp_hostname; ?>" /></td>
53 - <td>&nbsp;</td>
54 - </tr>
55 -</table>
56 -<hr size="1" color="#CCCCCC" />
57 -<div id="ex_smtp_host" class="explanation"><?php _e('This is a field setting the host name of a server for email transmission of a message. When the transmission of a message is not possible in localhost, a SMTP server is necessary.','usces'); ?></div>
58 -</div>
59 -</div><!--postbox-->
60 -
61 -<div class="postbox">
62 -<h3 class="hndle"><span><?php _e('Options','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_mail_options');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
63 -<div class="inside">
64 -<table class="form_table">
65 - <tr>
66 - <th width="150"><?php _e('New sign-in completion email','usces'); ?></th>
67 - <td width="10"><input name="newmem_admin_mail" type="radio" id="newmem_admin_mail_0" value="0"<?php if(0 == $newmem_admin_mail) echo ' checked="checked"'; ?> /></td>
68 - <td width="100"><label for="newmem_admin_mail_0">送信しない</label></td>
69 - <td width="10"><input name="newmem_admin_mail" type="radio" id="newmem_admin_mail_1" value="1"<?php if(1 == $newmem_admin_mail) echo ' checked="checked"'; ?> /></td>
70 - <td width="100"><label for="newmem_admin_mail_1">送信する</label></td>
71 - </tr>
72 -</table>
73 -<hr size="1" color="#CCCCCC" />
74 -<div id="ex_mail_options" class="explanation"><?php _e('When there is a new sign-in, I transmit a report email to a manager.','usces'); ?></div>
75 -</div>
76 -</div><!--postbox-->
77 -
78 -<div class="postbox">
79 -<h3 class="hndle"><span><?php _e('Thanks email(automatic transmission)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_thakyou_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
80 -<div class="inside">
81 -<table class="form_table">
82 - <tr>
83 - <th width="150"><?php _e('Title', 'usces'); ?></th>
84 - <td><input name="title[thankyou]" id="title[thankyou]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['thankyou']); ?>" /></td>
85 - <td>&nbsp;</td>
86 - </tr>
87 - <tr>
88 - <th><?php _e('header', 'usces'); ?></th>
89 - <td><textarea name="header[thankyou]" id="header[thankyou]" class="mail_header"><?php echo esc_html($mail_datas['header']['thankyou']); ?></textarea></td>
90 - <td>&nbsp;</td>
91 - </tr>
92 - <tr>
93 - <th><?php _e('footer', 'usces'); ?></th>
94 - <td><textarea name="footer[thankyou]" id="footer[thankyou]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['thankyou']); ?></textarea></td>
95 - <td>&nbsp;</td>
96 - </tr>
97 -</table>
98 -<hr size="1" color="#CCCCCC" />
99 -<div id="ex_thakyou_mail" class="explanation"><?php _e('This is an email transmitting a message for a visitor at the time of an order.', 'usces'); ?></div>
100 -</div>
101 -</div><!--postbox-->
102 -
103 -<div class="postbox">
104 -<h3 class="hndle"><span><?php _e('Order email(automatic transmission)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_order_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
105 -<div class="inside">
106 -<table class="form_table">
107 - <tr>
108 - <th width="150"><?php _e('Title', 'usces'); ?></th>
109 - <td><input name="title[order]" id="title[order]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['order']); ?>" /></td>
110 - <td>&nbsp;</td>
111 - </tr>
112 - <tr>
113 - <th><?php _e('header', 'usces'); ?></th>
114 - <td><textarea name="header[order]" id="header[order]" class="mail_header"><?php echo esc_html($mail_datas['header']['order']); ?></textarea></td>
115 - <td>&nbsp;</td>
116 - </tr>
117 - <tr>
118 - <th><?php _e('footer', 'usces'); ?></th>
119 - <td><textarea name="footer[order]" id="footer[order]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['order']); ?></textarea></td>
120 - <td>&nbsp;</td>
121 - </tr>
122 -</table>
123 -<hr size="1" color="#CCCCCC" />
124 -<div id="ex_order_mail" class="explanation"><?php echo sprintf(__('This is an email transmitting a message for owner of shop(%s).', 'usces'), $this->options['order_mail']); ?></div>
125 -</div>
126 -</div><!--postbox-->
127 -
128 -<div class="postbox">
129 -<h3 class="hndle"><span><?php _e('Inquiry receptionist email(automatic transmission)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_inquiry_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
130 -<div class="inside">
131 -<table class="form_table">
132 - <tr>
133 - <th width="150"><?php _e('Title', 'usces'); ?></th>
134 - <td><input name="title[inquiry]" id="title[inquiry]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['inquiry']); ?>" /></td>
135 - <td>&nbsp;</td>
136 - </tr>
137 - <tr>
138 - <th><?php _e('header', 'usces'); ?></th>
139 - <td><textarea name="header[inquiry]" id="header[inquiry]" class="mail_header"><?php echo esc_html($mail_datas['header']['inquiry']); ?></textarea></td>
140 - <td>&nbsp;</td>
141 - </tr>
142 - <tr>
143 - <th><?php _e('footer', 'usces'); ?></th>
144 - <td><textarea name="footer[inquiry]" id="footer[inquiry]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['inquiry']); ?></textarea></td>
145 - <td>&nbsp;</td>
146 - </tr>
147 -</table>
148 -<hr size="1" color="#CCCCCC" />
149 -<div id="ex_inquiry_mail" class="explanation"><?php _e('This is an e-mail which will be sent aytomatically to your customers at the contact from customer.', 'usces'); ?></div>
150 -</div>
151 -</div><!--postbox-->
152 -
153 -<div class="postbox">
154 -<h3 class="hndle"><span><?php _e('Conformation e-mail of membership registeration.', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_membercomp_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
155 -<div class="inside">
156 -<table class="form_table">
157 - <tr>
158 - <th width="150"><?php _e('Title', 'usces'); ?></th>
159 - <td><input name="title[membercomp]" id="title[membercomp]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['membercomp']); ?>" /></td>
160 - <td>&nbsp;</td>
161 - </tr>
162 - <tr>
163 - <th><?php _e('header', 'usces'); ?></th>
164 - <td><textarea name="header[membercomp]" id="header[membercomp]" class="mail_header"><?php echo esc_html($mail_datas['header']['membercomp']); ?></textarea></td>
165 - <td>&nbsp;</td>
166 - </tr>
167 - <tr>
168 - <th><?php _e('footer', 'usces'); ?></th>
169 - <td><textarea name="footer[membercomp]" id="footer[membercomp]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['membercomp']); ?></textarea></td>
170 - <td>&nbsp;</td>
171 - </tr>
172 -</table>
173 -<hr size="1" color="#CCCCCC" />
174 -<div id="ex_membercomp_mail" class="explanation"><?php _e('This is an e-mail which will be snnt automatically to your customers when their membership registration is completed.', 'usces'); ?></div>
175 -</div>
176 -</div><!--postbox-->
177 -
178 -
179 -<div class="postbox">
180 -<h3 class="hndle"><span><?php _e('Shipping complete email (sent from the admin)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_completionmail_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
181 -<div class="inside">
182 -<table class="form_table">
183 - <tr>
184 - <th width="150"><?php _e('Title', 'usces'); ?></th>
185 - <td><input name="title[completionmail]" id="title[completionmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['completionmail']); ?>" /></td>
186 - <td>&nbsp;</td>
187 - </tr>
188 - <tr>
189 - <th><?php _e('header', 'usces'); ?></th>
190 - <td><textarea name="header[completionmail]" id="header[completionmail]" class="mail_header"><?php echo esc_html($mail_datas['header']['completionmail']); ?></textarea></td>
191 - <td>&nbsp;</td>
192 - </tr>
193 - <tr>
194 - <th><?php _e('footer', 'usces'); ?></th>
195 - <td><textarea name="footer[completionmail]" id="footer[completionmail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['completionmail']); ?></textarea></td>
196 - <td>&nbsp;</td>
197 - </tr>
198 -</table>
199 -<hr size="1" color="#CCCCCC" />
200 -<div id="ex_completionmail_mail" class="explanation"><?php _e('This is an email transmitted manual operation to than a management screen, when the shipment of the article was completed.', 'usces'); ?></div>
201 -</div>
202 -</div><!--postbox-->
203 -
204 -<div class="postbox">
205 -<h3 class="hndle"><span><?php _e('Order confirmation email (sent from the admin)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_ordermail_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
206 -<div class="inside">
207 -<table class="form_table">
208 - <tr>
209 - <th width="150"><?php _e('Title', 'usces'); ?></th>
210 - <td><input name="title[ordermail]" id="title[ordermail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['ordermail']); ?>" /></td>
211 - <td>&nbsp;</td>
212 - </tr>
213 - <tr>
214 - <th><?php _e('header', 'usces'); ?></th>
215 - <td><textarea name="header[ordermail]" id="header[ordermail]" class="mail_header"><?php echo esc_html($mail_datas['header']['ordermail']); ?></textarea></td>
216 - <td>&nbsp;</td>
217 - </tr>
218 - <tr>
219 - <th><?php _e('footer', 'usces'); ?></th>
220 - <td><textarea name="footer[ordermail]" id="footer[ordermail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['ordermail']); ?></textarea></td>
221 - <td>&nbsp;</td>
222 - </tr>
223 -</table>
224 -<hr size="1" color="#CCCCCC" />
225 -<div id="ex_ordermail_mail" class="explanation"><?php _e('This is an email transmitted manual operation to than a management screen, when you registered a new order.', 'usces'); ?></div>
226 -</div>
227 -</div><!--postbox-->
228 -
229 -<div class="postbox">
230 -<h3 class="hndle"><span><?php _e('Confirmation mail for change of orders. (sent by admin.)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_changemail_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
231 -<div class="inside">
232 -<table class="form_table">
233 - <tr>
234 - <th width="150"><?php _e('Title', 'usces'); ?></th>
235 - <td><input name="title[changemail]" id="title[changemail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['changemail']); ?>" /></td>
236 - <td>&nbsp;</td>
237 - </tr>
238 - <tr>
239 - <th><?php _e('header', 'usces'); ?></th>
240 - <td><textarea name="header[changemail]" id="header[changemail]" class="mail_header"><?php echo esc_html($mail_datas['header']['changemail']); ?></textarea></td>
241 - <td>&nbsp;</td>
242 - </tr>
243 - <tr>
244 - <th><?php _e('footer', 'usces'); ?></th>
245 - <td><textarea name="footer[changemail]" id="footer[changemail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['changemail']); ?></textarea></td>
246 - <td>&nbsp;</td>
247 - </tr>
248 -</table>
249 -<hr size="1" color="#CCCCCC" />
250 -<div id="ex_changemail_mail" class="explanation"><?php _e('This is an e-mail which will be sent manually from admin screen, when there is changes of order.', 'usces'); ?></div>
251 -</div>
252 -</div><!--postbox-->
253 -
254 -<div class="postbox">
255 -<h3 class="hndle"><span><?php _e('Mail for Confirmation of payment. ( sent from admin)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_receiptmail_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
256 -<div class="inside">
257 -<table class="form_table">
258 - <tr>
259 - <th width="150"><?php _e('Title', 'usces'); ?></th>
260 - <td><input name="title[receiptmail]" id="title[receiptmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['receiptmail']); ?>" /></td>
261 - <td>&nbsp;</td>
262 - </tr>
263 - <tr>
264 - <th><?php _e('header', 'usces'); ?></th>
265 - <td><textarea name="header[receiptmail]" id="header[receiptmail]" class="mail_header"><?php echo esc_html($mail_datas['header']['receiptmail']); ?></textarea></td>
266 - <td>&nbsp;</td>
267 - </tr>
268 - <tr>
269 - <th><?php _e('footer', 'usces'); ?></th>
270 - <td><textarea name="footer[receiptmail]" id="footer[receiptmail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['receiptmail']); ?></textarea></td>
271 - <td>&nbsp;</td>
272 - </tr>
273 -</table>
274 -<hr size="1" color="#CCCCCC" />
275 -<div id="ex_receiptmail_mail" class="explanation"><?php _e('This is an e-mail which will be sent to customers when their transfer payment is confirmed.', 'usces'); ?></div>
276 -</div>
277 -</div><!--postbox-->
278 -
279 -<div class="postbox">
280 -<h3 class="hndle"><span><?php _e('Estimate email (sent from the admin)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_mitumorimail_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
281 -<div class="inside">
282 -<table class="form_table">
283 - <tr>
284 - <th width="150"><?php _e('Title', 'usces'); ?></th>
285 - <td><input name="title[mitumorimail]" id="title[mitumorimail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['mitumorimail']); ?>" /></td>
286 - <td>&nbsp;</td>
287 - </tr>
288 - <tr>
289 - <th><?php _e('header', 'usces'); ?></th>
290 - <td><textarea name="header[mitumorimail]" id="header[mitumorimail]" class="mail_header"><?php echo esc_html($mail_datas['header']['mitumorimail']); ?></textarea></td>
291 - <td>&nbsp;</td>
292 - </tr>
293 - <tr>
294 - <th><?php _e('footer', 'usces'); ?></th>
295 - <td><textarea name="footer[mitumorimail]" id="footer[mitumorimail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['mitumorimail']); ?></textarea></td>
296 - <td>&nbsp;</td>
297 - </tr>
298 -</table>
299 -<hr size="1" color="#CCCCCC" />
300 -<div id="ex_mitumorimail_mail" class="explanation"><?php _e('This is an email transmitted manual operation to than a management screen, when you registered an estimate.', 'usces'); ?></div>
301 -</div>
302 -</div><!--postbox-->
303 -
304 -<div class="postbox">
305 -<h3 class="hndle"><span><?php _e('E-mail for confirmation of cancellation. (sent from admin)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_cancelmail_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
306 -<div class="inside">
307 -<table class="form_table">
308 - <tr>
309 - <th width="150"><?php _e('Title', 'usces'); ?></th>
310 - <td><input name="title[cancelmail]" id="title[cancelmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['cancelmail']); ?>" /></td>
311 - <td>&nbsp;</td>
312 - </tr>
313 - <tr>
314 - <th><?php _e('header', 'usces'); ?></th>
315 - <td><textarea name="header[cancelmail]" id="header[cancelmail]" class="mail_header"><?php echo esc_html($mail_datas['header']['cancelmail']); ?></textarea></td>
316 - <td>&nbsp;</td>
317 - </tr>
318 - <tr>
319 - <th><?php _e('footer', 'usces'); ?></th>
320 - <td><textarea name="footer[cancelmail]" id="footer[cancelmail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['cancelmail']); ?></textarea></td>
321 - <td>&nbsp;</td>
322 - </tr>
323 -</table>
324 -<hr size="1" color="#CCCCCC" />
325 -<div id="ex_cancelmail_mail" class="explanation"><?php _e('This is an e-mail which will be sent when order has been canselled.', 'usces'); ?></div>
326 -</div>
327 -</div><!--postbox-->
328 -
329 -<div class="postbox">
330 -<h3 class="hndle"><span><?php _e('Other e-mails(sent from admin)', 'usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_othermail_mail');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
331 -<div class="inside">
332 -<table class="form_table">
333 - <tr>
334 - <th width="150"><?php _e('Title', 'usces'); ?></th>
335 - <td><input name="title[othermail]" id="title[othermail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['othermail']); ?>" /></td>
336 - <td>&nbsp;</td>
337 - </tr>
338 - <tr>
339 - <th><?php _e('header', 'usces'); ?></th>
340 - <td><textarea name="header[othermail]" id="header[othermail]" class="mail_header"><?php echo esc_html($mail_datas['header']['othermail']); ?></textarea></td>
341 - <td>&nbsp;</td>
342 - </tr>
343 - <tr>
344 - <th><?php _e('footer', 'usces'); ?></th>
345 - <td><textarea name="footer[othermail]" id="footer[othermail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['othermail']); ?></textarea></td>
346 - <td>&nbsp;</td>
347 - </tr>
348 -</table>
349 -<hr size="1" color="#CCCCCC" />
350 -<div id="ex_othermail_mail" class="explanation"><?php _e('e-mail which will be sent on temporaly basis', 'usces'); ?></div>
351 -</div>
352 -</div><!--postbox-->
353 -
354 -<?php do_action( 'usces_action_admin_mailform' ); ?>
355 -
356 -
357 -</div><!--poststuff-->
358 -<input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" />
359 -</form>
360 -</div><!--usces_admin-->
361 -</div><!--wrap-->
1 +<?php
2 +/**
3 + * Mail settings.
4 + *
5 + * @package Welcart
6 + * @since 2.3
7 + */
8 +
9 +$mail_datas = usces_mail_data();
10 +$smtp_hostname = ( ! isset( $this->options['smtp_hostname'] ) || empty( $this->options['smtp_hostname'] ) ) ? 'localhost' : $this->options['smtp_hostname'];
11 +if ( isset( $this->options['newmem_admin_mail'] ) && 1 == $this->options['newmem_admin_mail'] ) {
12 + $newmem_admin_mail_0 = '';
13 + $newmem_admin_mail_1 = ' checked="checked"';
14 +} else {
15 + $newmem_admin_mail_0 = ' checked="checked"';
16 + $newmem_admin_mail_1 = '';
17 +}
18 +if ( isset( $this->options['updmem_admin_mail'] ) && 1 == $this->options['updmem_admin_mail'] ) {
19 + $updmem_admin_mail_0 = '';
20 + $updmem_admin_mail_1 = ' checked="checked"';
21 +} else {
22 + $updmem_admin_mail_0 = ' checked="checked"';
23 + $updmem_admin_mail_1 = '';
24 +}
25 +if ( isset( $this->options['updmem_customer_mail'] ) && 1 == $this->options['updmem_customer_mail'] ) {
26 + $updmem_customer_mail_0 = '';
27 + $updmem_customer_mail_1 = ' checked="checked"';
28 +} else {
29 + $updmem_customer_mail_0 = ' checked="checked"';
30 + $updmem_customer_mail_1 = '';
31 +}
32 +if ( isset( $this->options['delmem_admin_mail'] ) && 1 == $this->options['delmem_admin_mail'] ) {
33 + $delmem_admin_mail_0 = '';
34 + $delmem_admin_mail_1 = ' checked="checked"';
35 +} else {
36 + $delmem_admin_mail_0 = ' checked="checked"';
37 + $delmem_admin_mail_1 = '';
38 +}
39 +if ( isset( $this->options['delmem_customer_mail'] ) && 1 == $this->options['delmem_customer_mail'] ) {
40 + $delmem_customer_mail_0 = '';
41 + $delmem_customer_mail_1 = ' checked="checked"';
42 +} else {
43 + $delmem_customer_mail_0 = ' checked="checked"';
44 + $delmem_customer_mail_1 = '';
45 +}
46 +if ( isset( $this->options['put_customer_name'] ) && 1 == $this->options['put_customer_name'] ) {
47 + $put_customer_name_0 = '';
48 + $put_customer_name_1 = ' checked="checked"';
49 +} else {
50 + $put_customer_name_0 = ' checked="checked"';
51 + $put_customer_name_1 = '';
52 +}
53 +if ( isset( $this->options['email_attach_feature'] ) && 1 == $this->options['email_attach_feature'] ) {
54 + $email_attach_feature_0 = '';
55 + $email_attach_feature_1 = ' checked="checked"';
56 +} else {
57 + $email_attach_feature_0 = ' checked="checked"';
58 + $email_attach_feature_1 = '';
59 +}
60 +if ( isset( $this->options['add_html_email_option'] ) && 1 == $this->options['add_html_email_option'] ) {
61 + $add_html_email_option_0 = '';
62 + $add_html_email_option_1 = ' checked="checked"';
63 + $add_html_email_option = true;
64 +} else {
65 + $add_html_email_option_0 = ' checked="checked"';
66 + $add_html_email_option_1 = '';
67 + $add_html_email_option = false;
68 +}
69 +$put_email_attach_file_extension = ( ! isset( $this->options['email_attach_file_extension'] ) || empty( $this->options['email_attach_file_extension'] ) ) ? 'jpg,png,pdf' : $this->options['email_attach_file_extension'];
70 +$put_email_attach_file_size = ( ! isset( $this->options['email_attach_file_size'] ) || empty( $this->options['email_attach_file_size'] ) ) ? 3 : $this->options['email_attach_file_size'];
71 +?>
72 +<?php if ( $add_html_email_option ) { ?>
73 +<style>
74 + .wp-editor-wrap {
75 + margin-top: 10px;
76 + background-color: #f0f0f1;
77 + }
78 + #dialog_parent {z-index: 100}
79 + #wrap_icon_loading {
80 + display: inline-block;
81 + padding-left: 10px;
82 + }
83 +</style>
84 +<?php } ?>
85 +<script type="text/javascript">
86 +jQuery( function($) {
87 + $( "#uscestabs_mail" ).tabs({
88 + active: ( $.cookie( "uscestabs_mail" ) ) ? $.cookie( "uscestabs_mail" ) : 0
89 + , activate: function( event, ui ) {
90 + $.cookie( "uscestabs_mail", $( this ).tabs( "option", "active" ) );
91 + }
92 + });
93 +<?php do_action( 'usces_action_mail_script' ); ?>
94 +});
95 +</script>
96 +<div class="wrap">
97 +<div class="usces_admin">
98 +<h1>Welcart Shop <?php _e( 'E-mail Setting', 'usces' ); ?></h1>
99 +<?php usces_admin_action_status(); ?>
100 +<div id="uscestabs_mail" class="uscestabs usces_mail">
101 + <ul>
102 + <li><a href="#uscestabs_mail_top"><?php _e( 'Mail Options', 'usces' ); ?></a></li>
103 + <li><a href="#uscestabs_mail_auto"><?php _e( 'Automatic emails', 'usces' ); ?></a></li>
104 + <li><a href="#uscestabs_mail_manual"><?php _e( 'Manual transmission emails', 'usces' ); ?></a></li>
105 + <li><a href="#uscestabs_mail_custom"><?php _e( 'Other emails', 'usces' ); ?></a></li>
106 + <?php do_action( 'usces_action_mail_tab_title' ); ?>
107 + </ul>
108 +
109 + <div id="uscestabs_mail_top">
110 + <form action="" method="post" name="option_form_top" id="option_form_top">
111 + <!-- SMTP hostname -->
112 + <div class="postbox">
113 + <h3><span><?php _e('SMTP server host','usces'); ?></span><a class="explanation-label" id="label_ex_smtp_host"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
114 + <div class="inside">
115 + <table class="form_table">
116 + <tr>
117 + <th width="150"><?php _e('Host name','usces'); ?></th>
118 + <td><input name="smtp_hostname" id="smtp_hostname" type="text" class="mail_title" value="<?php echo esc_attr( $smtp_hostname ); ?>" /></td>
119 + <td>&nbsp;</td>
120 + </tr>
121 + </table>
122 + <hr size="1" color="#CCCCCC" />
123 + <div id="ex_smtp_host" class="explanation"><?php _e('This is a field setting the host name of a server for email transmission of a message. When the transmission of a message is not possible in localhost, a SMTP server is necessary.','usces'); ?></div>
124 + </div>
125 + </div><!--postbox-->
126 + <!-- Options -->
127 + <div class="postbox">
128 + <h3><span><?php _e('Mail Options','usces'); ?></span><a class="explanation-label" id="label_ex_mail_options"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
129 + <div class="inside">
130 + <table class="form_table">
131 + <tr>
132 + <th width="150"><a class="explanation-label" id="label_ex_newmem_admin_mail"><?php _e('New sign-in completion email','usces'); ?></a></th>
133 + <td width="10"><input name="newmem_admin_mail" type="radio" id="newmem_admin_mail_0" value="0"<?php echo esc_attr( $newmem_admin_mail_0 ); ?> /></td>
134 + <td width="100"><label for="newmem_admin_mail_0"><?php _e("Don't send",'usces'); ?></label></td>
135 + <td width="10"><input name="newmem_admin_mail" type="radio" id="newmem_admin_mail_1" value="1"<?php echo esc_attr( $newmem_admin_mail_1 ); ?> /></td>
136 + <td width="100"><label for="newmem_admin_mail_1"><?php _e("Send",'usces'); ?></label></td>
137 + <td><div id="ex_newmem_admin_mail" class="explanation"><?php _e('When there is a new sign-in, transmit a report email to a manager.', 'usces'); ?></div></td>
138 + </tr>
139 + <tr>
140 + <th width="150"><a class="explanation-label" id="label_ex_updmem_admin_mail"><?php _e('Member update completion email to admin','usces'); ?></a></th>
141 + <td width="10"><input name="updmem_admin_mail" type="radio" id="updmem_admin_mail_0" value="0"<?php echo esc_attr( $updmem_admin_mail_0 ); ?> /></td>
142 + <td width="100"><label for="updmem_admin_mail_0"><?php _e("Don't send",'usces'); ?></label></td>
143 + <td width="10"><input name="updmem_admin_mail" type="radio" id="updmem_admin_mail_1" value="1"<?php echo esc_attr( $updmem_admin_mail_1 ); ?> /></td>
144 + <td width="100"><label for="updmem_admin_mail_1"><?php _e("Send",'usces'); ?></label></td>
145 + <td><div id="ex_updmem_admin_mail" class="explanation"><?php _e('When the member information has been changed, transmit a report mail to the manager.', 'usces'); ?></div></td>
146 + </tr>
147 + <tr>
148 + <th width="150"><a class="explanation-label" id="label_ex_updmem_customer_mail"><?php _e('Member update completion email to customer','usces'); ?></a></th>
149 + <td width="10"><input name="updmem_customer_mail" type="radio" id="updmem_customer_mail_0" value="0"<?php echo esc_attr( $updmem_customer_mail_0 ); ?> /></td>
150 + <td width="100"><label for="updmem_customer_mail_0"><?php _e("Don't send",'usces'); ?></label></td>
151 + <td width="10"><input name="updmem_customer_mail" type="radio" id="updmem_customer_mail_1" value="1"<?php echo esc_attr( $updmem_customer_mail_1 ); ?> /></td>
152 + <td width="100"><label for="updmem_customer_mail_1"><?php _e("Send",'usces'); ?></label></td>
153 + <td><div id="ex_updmem_customer_mail" class="explanation"><?php _e('When the member information has been changed, , transmit a guide mail to customer.', 'usces'); ?></div></td>
154 + </tr>
155 + <tr>
156 + <th width="150"><a class="explanation-label" id="label_ex_delmem_admin_mail"><?php _e('Member removal completion email to admin','usces'); ?></a></th>
157 + <td width="10"><input name="delmem_admin_mail" type="radio" id="delmem_admin_mail_0" value="0"<?php echo esc_attr( $delmem_admin_mail_0 ); ?> /></td>
158 + <td width="100"><label for="delmem_admin_mail_0"><?php _e("Don't send",'usces'); ?></label></td>
159 + <td width="10"><input name="delmem_admin_mail" type="radio" id="delmem_admin_mail_1" value="1"<?php echo esc_attr( $delmem_admin_mail_1 ); ?> /></td>
160 + <td width="100"><label for="delmem_admin_mail_1"><?php _e("Send",'usces'); ?></label></td>
161 + <td><div id="ex_delmem_admin_mail" class="explanation"><?php _e('When a member is unsubscribed, transmit a report mail to the manager.', 'usces'); ?></div></td>
162 + </tr>
163 + <tr>
164 + <th width="150"><a class="explanation-label" id="label_ex_delmem_customer_mail"><?php _e('Member removal completion email to customer','usces'); ?></a></th>
165 + <td width="10"><input name="delmem_customer_mail" type="radio" id="delmem_customer_mail_0" value="0"<?php echo esc_attr( $delmem_customer_mail_0 ); ?> /></td>
166 + <td width="100"><label for="delmem_customer_mail_0"><?php _e("Don't send",'usces'); ?></label></td>
167 + <td width="10"><input name="delmem_customer_mail" type="radio" id="delmem_customer_mail_1" value="1"<?php echo esc_attr( $delmem_customer_mail_1 ); ?> /></td>
168 + <td width="100"><label for="delmem_customer_mail_1"><?php _e("Send",'usces'); ?></label></td>
169 + <td><div id="ex_delmem_customer_mail" class="explanation"><?php _e('When a member is unsubscribed, transmit a guide mail to customer.', 'usces'); ?></div></td>
170 + </tr>
171 + <tr>
172 + <th width="150"><a class="explanation-label" id="label_ex_put_customer_name"><?php _e('Customer name','usces'); ?></a></th>
173 + <td width="10"><input name="put_customer_name" type="radio" id="put_customer_name_0" value="0"<?php echo esc_attr( $put_customer_name_0 ); ?> /></td>
174 + <td width="100"><label for="put_customer_name_0"><?php _e("Non-indication",'usces'); ?></label></td>
175 + <td width="10"><input name="put_customer_name" type="radio" id="put_customer_name_1" value="1"<?php echo esc_attr( $put_customer_name_1 ); ?> /></td>
176 + <td width="100"><label for="put_customer_name_1"><?php _e("Indication",'usces'); ?></label></td>
177 + <td><div id="ex_put_customer_name" class="explanation"><?php _e('At the beginning of the mail text, put customer name.', 'usces'); ?></div></td>
178 + </tr>
179 + <tr>
180 + <th width="150"><a class="explanation-label" id="label_ex_email_attach_feature"><?php _e('Attachment file for administrator email','usces'); ?></a></th>
181 + <td width="10"><input name="email_attach_feature" type="radio" id="email_attach_feature_0" value="0"<?php echo esc_attr( $email_attach_feature_0 ); ?> /></td>
182 + <td width="100"><label for="email_attach_feature_0"><?php _e("Do not Use",'usces'); ?></label></td>
183 + <td width="10"><input name="email_attach_feature" type="radio" id="email_attach_feature_1" value="1"<?php echo esc_attr( $email_attach_feature_1 ); ?> /></td>
184 + <td width="100"><label for="email_attach_feature_1"><?php _e("Use",'usces'); ?></label></td>
185 + <td><div id="ex_email_attach_feature" class="explanation"><?php _e('A file can be attached to the management e-mail sent from the order data edit page.', 'usces'); ?></div></td>
186 + </tr>
187 + <tr class="email_attach_feature">
188 + <th width="150"><a class="explanation-label" id="label_ex_put_file_extension"><?php _e('Extensions of attachments', 'usces'); ?></a></th>
189 + <td colspan="4"><input name="email_attach_file_extension" id="email_attach_file_extension" type="text" class="regular-text" value="<?php echo esc_attr($put_email_attach_file_extension); ?>" /></td>
190 + <td><div id="ex_put_file_extension" class="explanation"><?php _e('Enter the file extension of the email attachment (jpg, png, pdf, etc.) separated by commas.', 'usces'); ?></div></td>
191 + </tr>
192 + <tr class="email_attach_feature">
193 + <th width="150"><a class="explanation-label" id="label_ex_put_file_size"><?php _e('Maximum size of email attachment', 'usces'); ?></a></th>
194 + <td colspan="4"><input name="email_attach_file_size" id="email_attach_file_size" type="number" min="0" step="1" class="small-text" value="<?php echo esc_attr($put_email_attach_file_size); ?>" />Mb</td>
195 + <td><div id="ex_put_file_size" class="explanation"><?php _e('Enter the maximum file size (MB) of the email attached file.', 'usces'); ?><?php _e('If not entered, the file size is not checked.', 'usces'); ?></div></td>
196 + </tr>
197 + <tr>
198 + <th width="150"><a class="explanation-label" id="label_ex_add_html_email_option"><?php _e( 'HTML mail format', 'usces' ); ?></a></th>
199 + <td width="10"><input name="add_html_email_option" type="radio" id="add_html_email_option_0" value="0"<?php echo esc_attr( $add_html_email_option_0 ); ?> /></td>
200 + <td width="100"><label for="add_html_email_option_0"><?php _e("Do not Use",'usces'); ?></label></td>
201 + <td width="10"><input name="add_html_email_option" type="radio" id="add_html_email_option_1" value="1"<?php echo esc_attr( $add_html_email_option_1 ); ?> /></td>
202 + <td width="100"><label for="add_html_email_option_1"><?php _e("Use",'usces'); ?></label></td>
203 + <td><div id="ex_add_html_email_option" class="explanation"><?php _e('Send e-mails in HTML format.', 'usces'); ?></div></td>
204 + </tr>
205 + </table>
206 + <hr size="1" color="#CCCCCC" />
207 + <div id="ex_mail_options" class="explanation"><?php _e('Notification mail transmission setting, other.','usces'); ?></div>
208 + </div>
209 + </div><!--postbox-->
210 + <input name="usces_option_update_top" id="usces_option_update_mail_top" type="submit" class="button button-primary" value="<?php _e( 'change decision', 'usces' ); ?>" />
211 + <?php wp_nonce_field( 'admin_mail', 'wc_nonce' ); ?>
212 + <?php do_action( 'usces_action_admin_mailoption' ); ?>
213 + </form>
214 + </div><!-- uscestabs_mail_top -->
215 +
216 + <div id="uscestabs_mail_auto">
217 + <form action="" method="post" name="option_form_auto" id="option_form_auto">
218 + <!-- Thankyou mail -->
219 + <div class="postbox">
220 + <h3>
221 + <span id="title_thankyou"><?php _e('Thanks email(automatic transmission)', 'usces'); ?></span><a class="explanation-label" id="label_ex_thakyou_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
222 + <?php if ( $add_html_email_option ) { ?>
223 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('thankyou')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
224 + <?php } ?>
225 + </h3>
226 + <div class="inside">
227 + <table class="form_table">
228 + <tr>
229 + <th width="150"><?php _e('Title', 'usces'); ?></th>
230 + <td><input name="title[thankyou]" id="title[thankyou]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['thankyou']); ?>" /></td>
231 + <td>&nbsp;</td>
232 + </tr>
233 + <tr>
234 + <th><?php _e('header', 'usces'); ?></th>
235 + <td>
236 + <?php
237 + if ( $add_html_email_option ) {
238 + wp_editor(
239 + $mail_datas['header']['thankyou'],
240 + 'headerthankyou',
241 + array(
242 + 'tabfocus_elements' => ':next',
243 + 'dfw' => true,
244 + 'textarea_name' => 'header[thankyou]',
245 + 'textarea_rows' => 10,
246 + 'editor_class' => 'mail_header_html',
247 + 'editor_height' => '234'
248 + )
249 + );
250 + } else {
251 + ?>
252 + <textarea name="header[thankyou]" id="header[thankyou]" class="mail_header"><?php echo esc_html( $mail_datas['header']['thankyou'] ); ?></textarea>
253 + <?php } ?>
254 + </td>
255 + <td>&nbsp;</td>
256 + </tr>
257 + <tr>
258 + <th><?php _e('footer', 'usces'); ?></th>
259 + <td>
260 + <?php
261 + if ( $add_html_email_option ) {
262 + wp_editor(
263 + $mail_datas['footer']['thankyou'],
264 + 'footerthankyou',
265 + array(
266 + 'dfw' => true,
267 + 'tabindex' => 1,
268 + 'textarea_name' => 'footer[thankyou]',
269 + 'textarea_rows' => 10,
270 + 'editor_class' => 'mail_footer_html',
271 + 'editor_height' => '234'
272 + )
273 + );
274 + } else {
275 + ?>
276 + <textarea name="footer[thankyou]" id="footer[thankyou]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['thankyou'] ); ?></textarea>
277 + <?php } ?>
278 + </td>
279 + <td>&nbsp;</td>
280 + </tr>
281 + </table>
282 + <hr size="1" color="#CCCCCC" />
283 + <div id="ex_thakyou_mail" class="explanation"><?php _e('This is an email transmitting a message for a visitor at the time of an order.', 'usces'); ?></div>
284 + </div>
285 + </div><!--postbox-->
286 + <!-- Order mail -->
287 + <div class="postbox">
288 + <h3>
289 + <span id="title_order"><?php _e('Order email(automatic transmission)', 'usces'); ?></span><a class="explanation-label" id="label_ex_order_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
290 + <?php if ( $add_html_email_option ) { ?>
291 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('order')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
292 + <?php } ?>
293 + </h3>
294 + <div class="inside">
295 + <table class="form_table">
296 + <tr>
297 + <th width="150"><?php _e('Title', 'usces'); ?></th>
298 + <td><input name="title[order]" id="title[order]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['order']); ?>" /></td>
299 + <td>&nbsp;</td>
300 + </tr>
301 + <tr>
302 + <th><?php _e('header', 'usces'); ?></th>
303 + <td>
304 + <?php
305 + if ( $add_html_email_option ) {
306 + wp_editor(
307 + $mail_datas['header']['order'],
308 + 'headerorder',
309 + array(
310 + 'dfw' => true,
311 + 'tabindex' => 1,
312 + 'textarea_name' => 'header[order]',
313 + 'textarea_rows' => 10,
314 + 'editor_class' => 'mail_header_html',
315 + 'editor_height' => '234'
316 + )
317 + );
318 + } else {
319 + ?>
320 + <textarea name="header[order]" id="header[order]" class="mail_header"><?php echo esc_html( $mail_datas['header']['order'] ); ?></textarea>
321 + <?php } ?>
322 + </td>
323 + <td>&nbsp;</td>
324 + </tr>
325 + <tr>
326 + <th><?php _e('footer', 'usces'); ?></th>
327 + <td>
328 + <?php
329 + if ( $add_html_email_option ) {
330 + wp_editor(
331 + $mail_datas['footer']['order'],
332 + 'footerorder',
333 + array(
334 + 'dfw' => true,
335 + 'tabindex' => 1,
336 + 'textarea_name' => 'footer[order]',
337 + 'textarea_rows' => 10,
338 + 'editor_class' => 'mail_footer_html',
339 + 'editor_height' => '234'
340 + )
341 + );
342 + } else {
343 + ?>
344 + <textarea name="footer[order]" id="footer[order]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['order'] ); ?></textarea>
345 + <?php } ?>
346 + </td>
347 + <td>&nbsp;</td>
348 + </tr>
349 + </table>
350 + <hr size="1" color="#CCCCCC" />
351 + <div id="ex_order_mail" class="explanation"><?php echo sprintf(__('This is an email transmitting a message for owner of shop(%s).', 'usces'), esc_html( $this->options['order_mail'] ) ); ?></div>
352 + </div>
353 + </div><!--postbox-->
354 + <!-- Inquiry receipt mail -->
355 + <div class="postbox">
356 + <h3>
357 + <span id="title_inquiry"><?php _e('Inquiry receptionist email(automatic transmission)', 'usces'); ?></span><a class="explanation-label" id="label_ex_inquiry_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
358 + <?php if ( $add_html_email_option ) { ?>
359 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('inquiry')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
360 + <?php } ?>
361 + </h3>
362 + <div class="inside">
363 + <table class="form_table">
364 + <tr>
365 + <th width="150"><?php _e('Title', 'usces'); ?></th>
366 + <td><input name="title[inquiry]" id="title[inquiry]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['inquiry']); ?>" /></td>
367 + <td>&nbsp;</td>
368 + </tr>
369 + <tr>
370 + <th><?php _e('header', 'usces'); ?></th>
371 + <td>
372 + <?php
373 + if ( $add_html_email_option ) {
374 + wp_editor(
375 + $mail_datas['header']['inquiry'],
376 + 'headerinquiry',
377 + array(
378 + 'dfw' => true,
379 + 'tabindex' => 1,
380 + 'textarea_name' => 'header[inquiry]',
381 + 'textarea_rows' => 10,
382 + 'editor_class' => 'mail_header_html',
383 + 'editor_height' => '234'
384 + )
385 + );
386 + } else {
387 + ?>
388 + <textarea name="header[inquiry]" id="header[inquiry]" class="mail_header"><?php echo esc_html( $mail_datas['header']['inquiry'] ); ?></textarea>
389 + <?php } ?>
390 + </td>
391 + <td>&nbsp;</td>
392 + </tr>
393 + <tr>
394 + <th><?php _e('footer', 'usces'); ?></th>
395 + <td>
396 + <?php
397 + if ( $add_html_email_option ) {
398 + wp_editor(
399 + $mail_datas['footer']['inquiry'],
400 + 'footerinquiry',
401 + array(
402 + 'dfw' => true,
403 + 'tabindex' => 1,
404 + 'textarea_name' => 'footer[inquiry]',
405 + 'textarea_rows' => 10,
406 + 'editor_class' => 'mail_footer_html',
407 + 'editor_height' => '234'
408 + )
409 + );
410 + } else {
411 + ?>
412 + <textarea name="footer[inquiry]" id="footer[inquiry]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['inquiry'] ); ?></textarea>
413 + <?php } ?>
414 + </td>
415 + <td>&nbsp;</td>
416 + </tr>
417 + </table>
418 + <hr size="1" color="#CCCCCC" />
419 + <div id="ex_inquiry_mail" class="explanation"><?php _e('This is an e-mail which will be sent aytomatically to your customers at the contact from customer.', 'usces'); ?></div>
420 + </div>
421 + </div><!--postbox-->
422 + <!-- Membership completion mail -->
423 + <div class="postbox">
424 + <h3>
425 + <span id="title_membercomp"><?php _e('Conformation e-mail of membership registeration.', 'usces'); ?></span><a class="explanation-label" id="label_ex_membercomp_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
426 + <?php if ( $add_html_email_option ) { ?>
427 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('membercomp')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
428 + <?php } ?>
429 + </h3>
430 + <div class="inside">
431 + <table class="form_table">
432 + <tr>
433 + <th width="150"><?php _e('Title', 'usces'); ?></th>
434 + <td><input name="title[membercomp]" id="title[membercomp]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['membercomp']); ?>" /></td>
435 + <td>&nbsp;</td>
436 + </tr>
437 + <tr>
438 + <th><?php _e('header', 'usces'); ?></th>
439 + <td>
440 + <?php
441 + if ( $add_html_email_option ) {
442 + wp_editor(
443 + $mail_datas['header']['membercomp'],
444 + 'headermembercomp',
445 + array(
446 + 'dfw' => true,
447 + 'tabindex' => 1,
448 + 'textarea_name' => 'header[membercomp]',
449 + 'textarea_rows' => 10,
450 + 'editor_class' => 'mail_header_html',
451 + 'editor_height' => '234'
452 + )
453 + );
454 + } else {
455 + ?>
456 + <textarea name="header[membercomp]" id="header[membercomp]" class="mail_header"><?php echo esc_html( $mail_datas['header']['membercomp'] ); ?></textarea>
457 + <?php } ?>
458 + </td>
459 + <td>&nbsp;</td>
460 + </tr>
461 + <tr>
462 + <th><?php _e('footer', 'usces'); ?></th>
463 + <td>
464 + <?php
465 + if ( $add_html_email_option ) {
466 + wp_editor(
467 + $mail_datas['footer']['membercomp'],
468 + 'footermembercomp',
469 + array(
470 + 'dfw' => true,
471 + 'tabindex' => 1,
472 + 'textarea_name' => 'footer[membercomp]',
473 + 'textarea_rows' => 10,
474 + 'editor_class' => 'mail_footer_html',
475 + 'editor_height' => '234'
476 + )
477 + );
478 + } else {
479 + ?>
480 + <textarea name="footer[membercomp]" id="footer[membercomp]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['membercomp'] ); ?></textarea>
481 + <?php } ?>
482 + </td>
483 + <td>&nbsp;</td>
484 + </tr>
485 + </table>
486 + <hr size="1" color="#CCCCCC" />
487 + <div id="ex_membercomp_mail" class="explanation"><?php _e('This is an e-mail which will be snnt automatically to your customers when their membership registration is completed.', 'usces'); ?></div>
488 + </div>
489 + </div><!--postbox-->
490 + <?php do_action( 'usces_action_admin_mailoption_auto' ); ?>
491 + <input name="usces_option_update_auto" id="usces_option_update_mail_auto" type="submit" class="button button-primary" value="<?php _e( 'change decision', 'usces' ); ?>" />
492 + <?php wp_nonce_field( 'admin_mail', 'wc_nonce' ); ?>
493 + </form>
494 + </div><!-- uscestabs_mail_auto -->
495 +
496 + <div id="uscestabs_mail_manual">
497 + <form action="" method="post" name="option_form_manual" id="option_form_manual">
498 + <!-- Shipping completion mail -->
499 + <div class="postbox">
500 + <h3>
501 + <span id="title_completionmail"><?php _e('Shipping complete email (sent from the admin)', 'usces'); ?></span><a class="explanation-label" id="label_ex_completionmail_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
502 + <?php if ( $add_html_email_option ) { ?>
503 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('completionmail')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
504 + <?php } ?>
505 + </h3>
506 + <div class="inside">
507 + <table class="form_table">
508 + <tr>
509 + <th width="150"><?php _e('Title', 'usces'); ?></th>
510 + <td><input name="title[completionmail]" id="title[completionmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['completionmail']); ?>" /></td>
511 + <td>&nbsp;</td>
512 + </tr>
513 + <tr>
514 + <th><?php _e('header', 'usces'); ?></th>
515 + <td>
516 + <?php
517 + if ( $add_html_email_option ) {
518 + wp_editor(
519 + $mail_datas['header']['completionmail'],
520 + 'headercompletionmail',
521 + array(
522 + 'dfw' => true,
523 + 'tabindex' => 1,
524 + 'textarea_name' => 'header[completionmail]',
525 + 'textarea_rows' => 10,
526 + 'editor_class' => 'mail_header_html',
527 + 'editor_height' => '234'
528 + )
529 + );
530 + } else {
531 + ?>
532 + <textarea name="header[completionmail]" id="header[completionmail]" class="mail_header"><?php echo esc_html( $mail_datas['header']['completionmail'] ); ?></textarea>
533 + <?php } ?>
534 + </td>
535 + <td>&nbsp;</td>
536 + </tr>
537 + <tr>
538 + <th><?php _e('footer', 'usces'); ?></th>
539 + <td>
540 + <?php
541 + if ( $add_html_email_option ) {
542 + wp_editor(
543 + $mail_datas['footer']['completionmail'],
544 + 'footercompletionmail',
545 + array(
546 + 'dfw' => true,
547 + 'tabindex' => 1,
548 + 'textarea_name' => 'footer[completionmail]',
549 + 'textarea_rows' => 10,
550 + 'editor_class' => 'mail_footer_html',
551 + 'editor_height' => '234'
552 + )
553 + );
554 + } else {
555 + ?>
556 + <textarea name="footer[completionmail]" id="footer[completionmail]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['completionmail'] ); ?></textarea>
557 + <?php } ?>
558 + </td>
559 + <td>&nbsp;</td>
560 + </tr>
561 + </table>
562 + <hr size="1" color="#CCCCCC" />
563 + <div id="ex_completionmail_mail" class="explanation"><?php _e('This is an email transmitted manual operation to than a management screen, when the shipment of the article was completed.', 'usces'); ?></div>
564 + </div>
565 + </div><!--postbox-->
566 + <!-- Order confirmation mail -->
567 + <div class="postbox">
568 + <h3>
569 + <span id="title_ordermail"><?php _e('Order confirmation email (sent from the admin)', 'usces'); ?></span><a class="explanation-label" id="label_ex_ordermail_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
570 + <?php if ( $add_html_email_option ) { ?>
571 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('ordermail')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
572 + <?php } ?>
573 + </h3>
574 + <div class="inside">
575 + <table class="form_table">
576 + <tr>
577 + <th width="150"><?php _e('Title', 'usces'); ?></th>
578 + <td><input name="title[ordermail]" id="title[ordermail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['ordermail']); ?>" /></td>
579 + <td>&nbsp;</td>
580 + </tr>
581 + <tr>
582 + <th><?php _e('header', 'usces'); ?></th>
583 + <td>
584 + <?php
585 + if ( $add_html_email_option ) {
586 + wp_editor(
587 + $mail_datas['header']['ordermail'],
588 + 'headerordermail',
589 + array(
590 + 'dfw' => true,
591 + 'tabindex' => 1,
592 + 'textarea_name' => 'header[ordermail]',
593 + 'textarea_rows' => 10,
594 + 'editor_class' => 'mail_header_html',
595 + 'editor_height' => '234'
596 + )
597 + );
598 + } else {
599 + ?>
600 + <textarea name="header[ordermail]" id="header[ordermail]" class="mail_header"><?php echo esc_html( $mail_datas['header']['ordermail'] ); ?></textarea>
601 + <?php } ?>
602 + </td>
603 + <td>&nbsp;</td>
604 + </tr>
605 + <tr>
606 + <th><?php _e('footer', 'usces'); ?></th>
607 + <td>
608 + <?php
609 + if ( $add_html_email_option ) {
610 + wp_editor(
611 + $mail_datas['footer']['ordermail'],
612 + 'footerordermail',
613 + array(
614 + 'dfw' => true,
615 + 'tabindex' => 1,
616 + 'textarea_name' => 'footer[ordermail]',
617 + 'textarea_rows' => 10,
618 + 'editor_class' => 'mail_footer_html',
619 + 'editor_height' => '234'
620 + )
621 + );
622 + } else {
623 + ?>
624 + <textarea name="footer[ordermail]" id="footer[ordermail]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['ordermail'] ); ?></textarea>
625 + <?php } ?>
626 + </td>
627 + <td>&nbsp;</td>
628 + </tr>
629 + </table>
630 + <hr size="1" color="#CCCCCC" />
631 + <div id="ex_ordermail_mail" class="explanation"><?php _e('This is an email transmitted manual operation to than a management screen, when you registered a new order.', 'usces'); ?></div>
632 + </div>
633 + </div><!--postbox-->
634 + <!-- Order change confirmation mail -->
635 + <div class="postbox">
636 + <h3>
637 + <span id="title_changemail"><?php _e('Confirmation mail for change of orders. (sent by admin.)', 'usces'); ?></span><a class="explanation-label" id="label_ex_changemail_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
638 + <?php if ( $add_html_email_option ) { ?>
639 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('changemail')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
640 + <?php } ?>
641 + </h3>
642 + <div class="inside">
643 + <table class="form_table">
644 + <tr>
645 + <th width="150"><?php _e('Title', 'usces'); ?></th>
646 + <td><input name="title[changemail]" id="title[changemail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['changemail']); ?>" /></td>
647 + <td>&nbsp;</td>
648 + </tr>
649 + <tr>
650 + <th><?php _e('header', 'usces'); ?></th>
651 + <td>
652 + <?php
653 + if ( $add_html_email_option ) {
654 + wp_editor(
655 + $mail_datas['header']['changemail'],
656 + 'headerchangemail',
657 + array(
658 + 'dfw' => true,
659 + 'tabindex' => 1,
660 + 'textarea_name' => 'header[changemail]',
661 + 'textarea_rows' => 10,
662 + 'editor_class' => 'mail_header_html',
663 + 'editor_height' => '234'
664 + )
665 + );
666 + } else {
667 + ?>
668 + <textarea name="header[changemail]" id="header[changemail]" class="mail_header"><?php echo esc_html( $mail_datas['header']['changemail'] ); ?></textarea>
669 + <?php } ?>
670 + </td>
671 + <td>&nbsp;</td>
672 + </tr>
673 + <tr>
674 + <th><?php _e('footer', 'usces'); ?></th>
675 + <td>
676 + <?php
677 + if ( $add_html_email_option ) {
678 + wp_editor(
679 + $mail_datas['footer']['changemail'],
680 + 'footerchangemail',
681 + array(
682 + 'dfw' => true,
683 + 'tabindex' => 1,
684 + 'textarea_name' => 'footer[changemail]',
685 + 'textarea_rows' => 10,
686 + 'editor_class' => 'mail_footer_html',
687 + 'editor_height' => '234'
688 + )
689 + );
690 + } else {
691 + ?>
692 + <textarea name="footer[changemail]" id="footer[changemail]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['changemail'] ); ?></textarea>
693 + <?php } ?>
694 + </td>
695 + <td>&nbsp;</td>
696 + </tr>
697 + </table>
698 + <hr size="1" color="#CCCCCC" />
699 + <div id="ex_changemail_mail" class="explanation"><?php _e('This is an e-mail which will be sent manually from admin screen, when there is changes of order.', 'usces'); ?></div>
700 + </div>
701 + </div><!--postbox-->
702 + <!-- Payment confirmation mail -->
703 + <div class="postbox">
704 + <h3>
705 + <span id="title_receiptmail"><?php _e('Mail for Confirmation of payment. ( sent from admin)', 'usces'); ?></span><a class="explanation-label" id="label_ex_receiptmail_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
706 + <?php if ( $add_html_email_option ) { ?>
707 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('receiptmail')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
708 + <?php } ?>
709 + </h3>
710 + <div class="inside">
711 + <table class="form_table">
712 + <tr>
713 + <th width="150"><?php _e('Title', 'usces'); ?></th>
714 + <td><input name="title[receiptmail]" id="title[receiptmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['receiptmail']); ?>" /></td>
715 + <td>&nbsp;</td>
716 + </tr>
717 + <tr>
718 + <th><?php _e('header', 'usces'); ?></th>
719 + <td>
720 + <?php
721 + if ( $add_html_email_option ) {
722 + wp_editor(
723 + $mail_datas['header']['receiptmail'],
724 + 'headerreceiptmail',
725 + array(
726 + 'dfw' => true,
727 + 'tabindex' => 1,
728 + 'textarea_name' => 'header[receiptmail]',
729 + 'textarea_rows' => 10,
730 + 'editor_class' => 'mail_header_html',
731 + 'editor_height' => '234'
732 + )
733 + );
734 + } else {
735 + ?>
736 + <textarea name="header[receiptmail]" id="header[receiptmail]" class="mail_header"><?php echo esc_html( $mail_datas['header']['receiptmail'] ); ?></textarea>
737 + <?php } ?>
738 + </td>
739 + <td>&nbsp;</td>
740 + </tr>
741 + <tr>
742 + <th><?php _e('footer', 'usces'); ?></th>
743 + <td>
744 + <?php
745 + if ( $add_html_email_option ) {
746 + wp_editor(
747 + $mail_datas['footer']['receiptmail'],
748 + 'footerreceiptmail',
749 + array(
750 + 'dfw' => true,
751 + 'tabindex' => 1,
752 + 'textarea_name' => 'footer[receiptmail]',
753 + 'textarea_rows' => 10,
754 + 'editor_class' => 'mail_footer_html',
755 + 'editor_height' => '234'
756 + )
757 + );
758 + } else {
759 + ?>
760 + <textarea name="footer[receiptmail]" id="footer[receiptmail]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['receiptmail'] ); ?></textarea>
761 + <?php } ?>
762 + </td>
763 + <td>&nbsp;</td>
764 + </tr>
765 + </table>
766 + <hr size="1" color="#CCCCCC" />
767 + <div id="ex_receiptmail_mail" class="explanation"><?php _e('This is an e-mail which will be sent to customers when their transfer payment is confirmed.', 'usces'); ?></div>
768 + </div>
769 + </div><!--postbox-->
770 + <!-- Quotation mail -->
771 + <div class="postbox">
772 + <h3>
773 + <span id="title_mitumorimail"><?php _e('Estimate email (sent from the admin)', 'usces'); ?></span><a class="explanation-label" id="label_ex_mitumorimail_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
774 + <?php if ( $add_html_email_option ) { ?>
775 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('mitumorimail')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
776 + <?php } ?>
777 + </h3>
778 + <div class="inside">
779 + <table class="form_table">
780 + <tr>
781 + <th width="150"><?php _e('Title', 'usces'); ?></th>
782 + <td><input name="title[mitumorimail]" id="title[mitumorimail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['mitumorimail']); ?>" /></td>
783 + <td>&nbsp;</td>
784 + </tr>
785 + <tr>
786 + <th><?php _e('header', 'usces'); ?></th>
787 + <td>
788 + <?php
789 + if ( $add_html_email_option ) {
790 + wp_editor(
791 + $mail_datas['header']['mitumorimail'],
792 + 'headermitumorimail',
793 + array(
794 + 'dfw' => true,
795 + 'tabindex' => 1,
796 + 'textarea_name' => 'header[mitumorimail]',
797 + 'textarea_rows' => 10,
798 + 'editor_class' => 'mail_header_html',
799 + 'editor_height' => '234'
800 + )
801 + );
802 + } else {
803 + ?>
804 + <textarea name="header[mitumorimail]" id="header[mitumorimail]" class="mail_header"><?php echo esc_html( $mail_datas['header']['mitumorimail'] ); ?></textarea>
805 + <?php } ?>
806 + </td>
807 + <td>&nbsp;</td>
808 + </tr>
809 + <tr>
810 + <th><?php _e('footer', 'usces'); ?></th>
811 + <td>
812 + <?php
813 + if ( $add_html_email_option ) {
814 + wp_editor(
815 + $mail_datas['footer']['mitumorimail'],
816 + 'footermitumorimail',
817 + array(
818 + 'dfw' => true,
819 + 'tabindex' => 1,
820 + 'textarea_name' => 'footer[mitumorimail]',
821 + 'textarea_rows' => 10,
822 + 'editor_class' => 'mail_footer_html',
823 + 'editor_height' => '234'
824 + )
825 + );
826 + } else {
827 + ?>
828 + <textarea name="footer[mitumorimail]" id="footer[mitumorimail]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['mitumorimail'] ); ?></textarea>
829 + <?php } ?>
830 + </td>
831 + <td>&nbsp;</td>
832 + </tr>
833 + </table>
834 + <hr size="1" color="#CCCCCC" />
835 + <div id="ex_mitumorimail_mail" class="explanation"><?php _e('This is an email transmitted manual operation to than a management screen, when you registered an estimate.', 'usces'); ?></div>
836 + </div>
837 + </div><!--postbox-->
838 + <!-- Cancellation confirmation mail -->
839 + <div class="postbox">
840 + <h3>
841 + <span id="title_cancelmail"><?php _e('E-mail for confirmation of cancellation. (sent from admin)', 'usces'); ?></span><a class="explanation-label" id="label_ex_cancelmail_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
842 + <?php if ( $add_html_email_option ) { ?>
843 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('cancelmail')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
844 + <?php } ?>
845 + </h3>
846 + <div class="inside">
847 + <table class="form_table">
848 + <tr>
849 + <th width="150"><?php _e('Title', 'usces'); ?></th>
850 + <td><input name="title[cancelmail]" id="title[cancelmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['cancelmail']); ?>" /></td>
851 + <td>&nbsp;</td>
852 + </tr>
853 + <tr>
854 + <th><?php _e('header', 'usces'); ?></th>
855 + <td>
856 + <?php
857 + if ( $add_html_email_option ) {
858 + wp_editor(
859 + $mail_datas['header']['cancelmail'],
860 + 'headercancelmail',
861 + array(
862 + 'dfw' => true,
863 + 'tabindex' => 1,
864 + 'textarea_name' => 'header[cancelmail]',
865 + 'textarea_rows' => 10,
866 + 'editor_class' => 'mail_header_html',
867 + 'editor_height' => '234'
868 + )
869 + );
870 + } else {
871 + ?>
872 + <textarea name="header[cancelmail]" id="header[cancelmail]" class="mail_header"><?php echo esc_html( $mail_datas['header']['cancelmail'] ); ?></textarea>
873 + <?php } ?>
874 + </td>
875 + <td>&nbsp;</td>
876 + </tr>
877 + <tr>
878 + <th><?php _e('footer', 'usces'); ?></th>
879 + <td>
880 + <?php
881 + if ( $add_html_email_option ) {
882 + wp_editor(
883 + $mail_datas['footer']['cancelmail'],
884 + 'footercancelmail',
885 + array(
886 + 'dfw' => true,
887 + 'tabindex' => 1,
888 + 'textarea_name' => 'footer[cancelmail]',
889 + 'textarea_rows' => 10,
890 + 'editor_class' => 'mail_footer_html',
891 + 'editor_height' => '234'
892 + )
893 + );
894 + } else {
895 + ?>
896 + <textarea name="footer[cancelmail]" id="footer[cancelmail]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['cancelmail'] ); ?></textarea>
897 + <?php } ?>
898 + </td>
899 + <td>&nbsp;</td>
900 + </tr>
901 + </table>
902 + <hr size="1" color="#CCCCCC" />
903 + <div id="ex_cancelmail_mail" class="explanation"><?php _e('This is an e-mail which will be sent when order has been canselled.', 'usces'); ?></div>
904 + </div>
905 + </div><!--postbox-->
906 + <?php do_action( 'usces_action_admin_mailoption_manual' ); ?>
907 + <input name="usces_option_update_manual" id="usces_option_update_mail_manual" type="submit" class="button button-primary" value="<?php _e( 'change decision', 'usces' ); ?>" />
908 + <?php wp_nonce_field( 'admin_mail', 'wc_nonce' ); ?>
909 + </form>
910 + </div><!-- uscestabs_mail_manual -->
911 +
912 + <div id="uscestabs_mail_custom">
913 + <form action="" method="post" name="option_form" id="option_form">
914 + <!-- Other mail -->
915 + <div class="postbox">
916 + <h3>
917 + <span id="title_othermail"><?php _e('Other e-mails(sent from admin)', 'usces'); ?></span><a class="explanation-label" id="label_ex_othermail_mail"> (<?php _e('explanation', 'usces'); ?>) </a>
918 + <?php if ( $add_html_email_option ) { ?>
919 + <button type="button" class="email-preview button-primary" onclick="showPopupPreviewEmail('othermail')"><?php esc_attr_e( 'Preview', 'usces' ); ?></button>
920 + <?php } ?>
921 + </h3>
922 + <div class="inside">
923 + <table class="form_table">
924 + <tr>
925 + <th width="150"><?php _e('Title', 'usces'); ?></th>
926 + <td><input name="title[othermail]" id="title[othermail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['othermail']); ?>" /></td>
927 + <td>&nbsp;</td>
928 + </tr>
929 + <tr>
930 + <th><?php _e('header', 'usces'); ?></th>
931 + <td>
932 + <?php
933 + if ( $add_html_email_option ) {
934 + wp_editor(
935 + $mail_datas['header']['othermail'],
936 + 'headerothermail',
937 + array(
938 + 'dfw' => true,
939 + 'tabindex' => 1,
940 + 'textarea_name' => 'header[othermail]',
941 + 'textarea_rows' => 10,
942 + 'editor_class' => 'mail_header_html',
943 + 'editor_height' => '234'
944 + )
945 + );
946 + } else {
947 + ?>
948 + <textarea name="header[othermail]" id="header[othermail]" class="mail_header"><?php echo esc_html( $mail_datas['header']['othermail'] ); ?></textarea>
949 + <?php } ?>
950 + </td>
951 + <td>&nbsp;</td>
952 + </tr>
953 + <tr>
954 + <th><?php _e('footer', 'usces'); ?></th>
955 + <td>
956 + <?php
957 + if ( $add_html_email_option ) {
958 + wp_editor(
959 + $mail_datas['footer']['othermail'],
960 + 'footerothermail',
961 + array(
962 + 'dfw' => true,
963 + 'tabindex' => 1,
964 + 'textarea_name' => 'footer[othermail]',
965 + 'textarea_rows' => 10,
966 + 'editor_class' => 'mail_footer_html',
967 + 'editor_height' => '234'
968 + )
969 + );
970 + } else {
971 + ?>
972 + <textarea name="footer[othermail]" id="footer[othermail]" class="mail_footer"><?php echo esc_html( $mail_datas['footer']['othermail'] ); ?></textarea>
973 + <?php } ?>
974 + </td>
975 + <td>&nbsp;</td>
976 + </tr>
977 + </table>
978 + <hr size="1" color="#CCCCCC" />
979 + <div id="ex_othermail_mail" class="explanation"><?php _e('e-mail which will be sent on temporaly basis', 'usces'); ?></div>
980 + </div>
981 + </div><!--postbox-->
982 + <?php do_action( 'usces_action_admin_mailform' ); ?>
983 + <input name="usces_option_update" id="usces_option_update_mail" type="submit" class="button button-primary" value="<?php _e( 'change decision', 'usces' ); ?>" />
984 + <?php wp_nonce_field( 'admin_mail', 'wc_nonce' ); ?>
985 + </form>
986 + </div><!-- uscestabs_mail_custom -->
987 + <?php do_action( 'usces_action_mail_tab_body' ); ?>
988 +</div><!--uscestabs-->
989 +</div><!--usces_admin-->
990 +</div><!--wrap-->
991 +<?php do_action( 'usces_action_auto_mailform' ); ?>
992 +<?php if ( $add_html_email_option ) { ?>
993 +<div id="dialog_parent" style="position:fixed"></div>
994 +<div id="previewEmailDialog" title="">
995 + <iframe src="" width="760" height="1000" frameborder="0" class="content_email_preview" id="iframePreviewEmail"></iframe>
996 +</div>
997 +<script type='text/javascript'>
998 + jQuery(function($){
999 + $("#previewEmailDialog").dialog({
1000 + bgiframe: true,
1001 + autoOpen: false,
1002 + height: 650,
1003 + width: 800,
1004 + resizable: true,
1005 + modal: true,
1006 + buttons: [
1007 + {
1008 + text: "<?php esc_attr_e( 'close', 'usces' ); ?>",
1009 + click: function() {
1010 + $(this).dialog('close');
1011 + }
1012 + }
1013 + ],
1014 + appendTo:"#dialog_parent",
1015 + close: function() {
1016 + jQuery('#previewEmailDialog').dialog('option', 'title', "");
1017 + var dstFrame = document.getElementById('iframePreviewEmail');
1018 + var dstDoc = dstFrame.contentDocument || dstFrame.contentWindow.document;
1019 + dstDoc.write("");
1020 + dstDoc.close();
1021 + }
1022 + });
1023 + });
1024 +
1025 +
1026 +usces_admin_mail = {
1027 + settings: {
1028 + url: uscesL10n.requestFile,
1029 + type: 'POST',
1030 + cache: false
1031 + },
1032 + filterContentbeforePreview: function( elEmail ) {
1033 + var elEmailHeader = 'header'+elEmail;
1034 + var elEmailfooter = 'footer'+elEmail;
1035 + var elTitleDialog = 'title_'+elEmail;
1036 + var parent_preview = jQuery("#"+elTitleDialog).parent();
1037 + var img_loading = '<div id="wrap_icon_loading"><img src="' + uscesL10n.USCES_PLUGIN_URL + 'images/loading.gif" /></div>';
1038 + var element_preview = jQuery(parent_preview).children(".email-preview");
1039 + jQuery(img_loading).insertAfter(element_preview);
1040 + jQuery(element_preview).prop("disabled", true);
1041 + var titleDialog = "<?php esc_attr_e( 'Preview', 'usces' ); ?>: " + jQuery("#"+elTitleDialog).text();
1042 + var contentEmailHeader = '';
1043 + var contentEmailFooter = '';
1044 + if (typeof tinymce !== 'undefined' && tinymce.get(elEmailHeader)) {
1045 + if ( jQuery("#"+elEmailHeader).is(':visible') ) {
1046 + // TEXT TAB active.
1047 + contentEmailHeader = jQuery("#"+elEmailHeader).val();
1048 + } else {
1049 + // VISUAL TAB active.
1050 + contentEmailHeader = tinymce.get(elEmailHeader).getContent();
1051 + }
1052 + } else {
1053 + contentEmailHeader = jQuery("#"+elEmailHeader).val();
1054 + }
1055 + if (typeof tinymce !== 'undefined' && tinymce.get(elEmailfooter)) {
1056 + if ( jQuery("#"+elEmailHeader).is(':visible') ) {
1057 + // TEXT TAB active.
1058 + contentEmailFooter = jQuery("#"+elEmailfooter).val();
1059 + } else {
1060 + // VISUAL TAB active.
1061 + contentEmailFooter = tinymce.get(elEmailfooter).getContent();
1062 + }
1063 + } else {
1064 + contentEmailFooter = jQuery("#"+elEmailfooter).val();
1065 + }
1066 + var s = usces_admin_mail.settings;
1067 + s.data = {
1068 + 'action': 'usces_filter_content_wp_editor_preview',
1069 + 'mode': 'preview_email',
1070 + 'wc_nonce': '<?php echo wp_create_nonce( 'wc_preview_editor_nonce' ); ?>',
1071 + 'content_header': contentEmailHeader.replace(/<script>/g,'&lt;script&gt;').replace(/<\/script>/g,'&lt;/script&gt;'),
1072 + 'content_footer': contentEmailFooter.replace(/<script>/g,'&lt;script&gt;').replace(/<\/script>/g,'&lt;/script&gt;'),
1073 + };
1074 + jQuery.ajax(s).done(function(res) {
1075 + jQuery("#wrap_icon_loading").remove();
1076 + if (res && res.status) {
1077 + var content = usces_admin_mail.contentHtmlShow( res.content_header, res.content_footer );
1078 + var dstFrame = document.getElementById('iframePreviewEmail');
1079 + var dstDoc = dstFrame.contentDocument || dstFrame.contentWindow.document;
1080 + dstDoc.write(content);
1081 + dstDoc.close();
1082 +
1083 + jQuery('#previewEmailDialog').dialog('option', 'title', titleDialog);
1084 + jQuery('#previewEmailDialog').dialog('open');
1085 + } else {
1086 + usces_admin_mail.contentPreviewErrorShow( '<?php _e( 'Failure preview email.', 'usces' ); ?>' );
1087 + }
1088 + jQuery(element_preview).removeAttr('disabled');
1089 + }).fail(function(msg) {
1090 + jQuery("#wrap_icon_loading").remove();
1091 + jQuery(element_preview).removeAttr('disabled');
1092 + usces_admin_mail.contentPreviewErrorShow( msg );
1093 + });
1094 + },
1095 + contentHtmlShow: function( contentEmailHeader, contentEmailFooter ) {
1096 + var content = '<table bgcolor="#eeeeee" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>';
1097 + content += '<table style="font-size: 15px; margin-right:auto;margin-left:auto;" bgcolor="#ffffff" width="600" cellpadding="0" cellspacing="0" border="0" align="center">';
1098 + content += '<tr><td style="padding:20px 30px;">';
1099 + content += contentEmailHeader;
1100 + content += '</td></tr>';
1101 + content += '<tr><td style="padding:20px 30px;">';
1102 + content += '<strong>';
1103 + content += "<?php esc_attr_e( '- Order details -', 'usces' ); ?>";
1104 + content += '</strong>';
1105 + content += '</td></tr>';
1106 + content += '<tr><td style="padding:20px 30px;">';
1107 + content += contentEmailFooter;
1108 + content += '</td></tr></table></td></tr></table>';
1109 + return content;
1110 + },
1111 + contentPreviewErrorShow: function( msg ) {
1112 + var dstFrame = document.getElementById('iframePreviewEmail');
1113 + var dstDoc = dstFrame.contentDocument || dstFrame.contentWindow.document;
1114 + dstDoc.write( msg );
1115 + dstDoc.close();
1116 + jQuery('#previewEmailDialog').dialog('option', 'title', 'ERROR');
1117 + jQuery('#previewEmailDialog').dialog('open');
1118 + }
1119 +};
1120 +
1121 +function showPopupPreviewEmail( elEmail ) {
1122 + usces_admin_mail.filterContentbeforePreview( elEmail );
1123 +}
1124 +</script>
1125 +<?php } ?>