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 -377 1.4.02.12.4 View file →
@@ -1,377 +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 -$delmem_admin_mail = $this->options['delmem_admin_mail'];
10 -$delmem_customer_mail = $this->options['delmem_customer_mail'];
11 -?>
12 -<script type="text/javascript">
13 -jQuery(function($){
14 -<?php if($status == 'success'){ ?>
15 - $("#anibox").animate({ backgroundColor: "#ECFFFF" }, 2000);
16 -<?php }else if($status == 'caution'){ ?>
17 - $("#anibox").animate({ backgroundColor: "#FFF5CE" }, 2000);
18 -<?php }else if($status == 'error'){ ?>
19 - $("#anibox").animate({ backgroundColor: "#FFE6E6" }, 2000);
20 -<?php } ?>
21 -
22 - $("#aAdditionalURLs").click(function () {
23 - $("#AdditionalURLs").toggle();
24 - });
25 -});
26 -
27 -function toggleVisibility(id) {
28 - var e = document.getElementById(id);
29 - if(e.style.display == 'block')
30 - e.style.display = 'none';
31 - else
32 - e.style.display = 'block';
33 -}
34 -</script>
35 -<div class="wrap">
36 -<div class="usces_admin">
37 -<h2>Welcart Shop <?php _e('E-mail Setting','usces'); ?></h2>
38 -<div id="aniboxStatus" class="<?php echo $status; ?>">
39 - <div id="anibox" class="clearfix">
40 - <img src="<?php echo USCES_PLUGIN_URL; ?>/images/list_message_<?php echo $status; ?>.gif" />
41 - <div class="mes" id="info_massage"><?php echo $message; ?></div>
42 - </div>
43 -</div>
44 -<form action="" method="post" name="option_form" id="option_form">
45 -<input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" />
46 -<div id="poststuff" class="metabox-holder">
47 -
48 -<div class="postbox">
49 -<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>
50 -<div class="inside">
51 -<table class="form_table">
52 - <tr>
53 - <th width="150"><?php _e('Host name','usces'); ?></th>
54 - <td><input name="smtp_hostname" id="smtp_hostname" type="text" class="mail_title" value="<?php echo $smtp_hostname; ?>" /></td>
55 - <td>&nbsp;</td>
56 - </tr>
57 -</table>
58 -<hr size="1" color="#CCCCCC" />
59 -<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>
60 -</div>
61 -</div><!--postbox-->
62 -
63 -<div class="postbox">
64 -<h3 class="hndle"><span><?php _e('Options','usces'); ?></span><a style="cursor:pointer;" onclick="toggleVisibility('ex_mail_options');"> (<?php _e('explanation', 'usces'); ?>) </a></h3>
65 -<div class="inside">
66 -<table class="form_table">
67 - <tr>
68 - <th width="150"><?php _e('New sign-in completion email','usces'); ?></th>
69 - <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>
70 - <td width="100"><label for="newmem_admin_mail_0"><?php _e("Don't send",'usces'); ?></label></td>
71 - <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>
72 - <td width="100"><label for="newmem_admin_mail_1"><?php _e("Send",'usces'); ?></label></td>
73 - </tr>
74 - <tr>
75 - <th width="150"><?php _e('Member removal completion email to admin','usces'); ?></th>
76 - <td width="10"><input name="delmem_admin_mail" type="radio" id="delmem_admin_mail_0" value="0"<?php if(0 == $delmem_admin_mail) echo ' checked="checked"'; ?> /></td>
77 - <td width="100"><label for="delmem_admin_mail_0"><?php _e("Don't send",'usces'); ?></label></td>
78 - <td width="10"><input name="delmem_admin_mail" type="radio" id="delmem_admin_mail_1" value="1"<?php if(1 == $delmem_admin_mail) echo ' checked="checked"'; ?> /></td>
79 - <td width="100"><label for="delmem_admin_mail_1"><?php _e("Send",'usces'); ?></label></td>
80 - </tr>
81 - <tr>
82 - <th width="150"><?php _e('Member removal completion email to customer','usces'); ?></th>
83 - <td width="10"><input name="delmem_customer_mail" type="radio" id="delmem_customer_mail_0" value="0"<?php if(0 == $delmem_customer_mail) echo ' checked="checked"'; ?> /></td>
84 - <td width="100"><label for="delmem_customer_mail_0"><?php _e("Don't send",'usces'); ?></label></td>
85 - <td width="10"><input name="delmem_customer_mail" type="radio" id="delmem_customer_mail_1" value="1"<?php if(1 == $delmem_customer_mail) echo ' checked="checked"'; ?> /></td>
86 - <td width="100"><label for="delmem_customer_mail_1"><?php _e("Send",'usces'); ?></label></td>
87 - </tr>
88 -</table>
89 -<hr size="1" color="#CCCCCC" />
90 -<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>
91 -</div>
92 -</div><!--postbox-->
93 -
94 -<div class="postbox">
95 -<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>
96 -<div class="inside">
97 -<table class="form_table">
98 - <tr>
99 - <th width="150"><?php _e('Title', 'usces'); ?></th>
100 - <td><input name="title[thankyou]" id="title[thankyou]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['thankyou']); ?>" /></td>
101 - <td>&nbsp;</td>
102 - </tr>
103 - <tr>
104 - <th><?php _e('header', 'usces'); ?></th>
105 - <td><textarea name="header[thankyou]" id="header[thankyou]" class="mail_header"><?php echo esc_html($mail_datas['header']['thankyou']); ?></textarea></td>
106 - <td>&nbsp;</td>
107 - </tr>
108 - <tr>
109 - <th><?php _e('footer', 'usces'); ?></th>
110 - <td><textarea name="footer[thankyou]" id="footer[thankyou]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['thankyou']); ?></textarea></td>
111 - <td>&nbsp;</td>
112 - </tr>
113 -</table>
114 -<hr size="1" color="#CCCCCC" />
115 -<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>
116 -</div>
117 -</div><!--postbox-->
118 -
119 -<div class="postbox">
120 -<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>
121 -<div class="inside">
122 -<table class="form_table">
123 - <tr>
124 - <th width="150"><?php _e('Title', 'usces'); ?></th>
125 - <td><input name="title[order]" id="title[order]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['order']); ?>" /></td>
126 - <td>&nbsp;</td>
127 - </tr>
128 - <tr>
129 - <th><?php _e('header', 'usces'); ?></th>
130 - <td><textarea name="header[order]" id="header[order]" class="mail_header"><?php echo esc_html($mail_datas['header']['order']); ?></textarea></td>
131 - <td>&nbsp;</td>
132 - </tr>
133 - <tr>
134 - <th><?php _e('footer', 'usces'); ?></th>
135 - <td><textarea name="footer[order]" id="footer[order]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['order']); ?></textarea></td>
136 - <td>&nbsp;</td>
137 - </tr>
138 -</table>
139 -<hr size="1" color="#CCCCCC" />
140 -<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>
141 -</div>
142 -</div><!--postbox-->
143 -
144 -<div class="postbox">
145 -<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>
146 -<div class="inside">
147 -<table class="form_table">
148 - <tr>
149 - <th width="150"><?php _e('Title', 'usces'); ?></th>
150 - <td><input name="title[inquiry]" id="title[inquiry]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['inquiry']); ?>" /></td>
151 - <td>&nbsp;</td>
152 - </tr>
153 - <tr>
154 - <th><?php _e('header', 'usces'); ?></th>
155 - <td><textarea name="header[inquiry]" id="header[inquiry]" class="mail_header"><?php echo esc_html($mail_datas['header']['inquiry']); ?></textarea></td>
156 - <td>&nbsp;</td>
157 - </tr>
158 - <tr>
159 - <th><?php _e('footer', 'usces'); ?></th>
160 - <td><textarea name="footer[inquiry]" id="footer[inquiry]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['inquiry']); ?></textarea></td>
161 - <td>&nbsp;</td>
162 - </tr>
163 -</table>
164 -<hr size="1" color="#CCCCCC" />
165 -<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>
166 -</div>
167 -</div><!--postbox-->
168 -
169 -<div class="postbox">
170 -<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>
171 -<div class="inside">
172 -<table class="form_table">
173 - <tr>
174 - <th width="150"><?php _e('Title', 'usces'); ?></th>
175 - <td><input name="title[membercomp]" id="title[membercomp]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['membercomp']); ?>" /></td>
176 - <td>&nbsp;</td>
177 - </tr>
178 - <tr>
179 - <th><?php _e('header', 'usces'); ?></th>
180 - <td><textarea name="header[membercomp]" id="header[membercomp]" class="mail_header"><?php echo esc_html($mail_datas['header']['membercomp']); ?></textarea></td>
181 - <td>&nbsp;</td>
182 - </tr>
183 - <tr>
184 - <th><?php _e('footer', 'usces'); ?></th>
185 - <td><textarea name="footer[membercomp]" id="footer[membercomp]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['membercomp']); ?></textarea></td>
186 - <td>&nbsp;</td>
187 - </tr>
188 -</table>
189 -<hr size="1" color="#CCCCCC" />
190 -<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>
191 -</div>
192 -</div><!--postbox-->
193 -
194 -
195 -<div class="postbox">
196 -<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>
197 -<div class="inside">
198 -<table class="form_table">
199 - <tr>
200 - <th width="150"><?php _e('Title', 'usces'); ?></th>
201 - <td><input name="title[completionmail]" id="title[completionmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['completionmail']); ?>" /></td>
202 - <td>&nbsp;</td>
203 - </tr>
204 - <tr>
205 - <th><?php _e('header', 'usces'); ?></th>
206 - <td><textarea name="header[completionmail]" id="header[completionmail]" class="mail_header"><?php echo esc_html($mail_datas['header']['completionmail']); ?></textarea></td>
207 - <td>&nbsp;</td>
208 - </tr>
209 - <tr>
210 - <th><?php _e('footer', 'usces'); ?></th>
211 - <td><textarea name="footer[completionmail]" id="footer[completionmail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['completionmail']); ?></textarea></td>
212 - <td>&nbsp;</td>
213 - </tr>
214 -</table>
215 -<hr size="1" color="#CCCCCC" />
216 -<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>
217 -</div>
218 -</div><!--postbox-->
219 -
220 -<div class="postbox">
221 -<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>
222 -<div class="inside">
223 -<table class="form_table">
224 - <tr>
225 - <th width="150"><?php _e('Title', 'usces'); ?></th>
226 - <td><input name="title[ordermail]" id="title[ordermail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['ordermail']); ?>" /></td>
227 - <td>&nbsp;</td>
228 - </tr>
229 - <tr>
230 - <th><?php _e('header', 'usces'); ?></th>
231 - <td><textarea name="header[ordermail]" id="header[ordermail]" class="mail_header"><?php echo esc_html($mail_datas['header']['ordermail']); ?></textarea></td>
232 - <td>&nbsp;</td>
233 - </tr>
234 - <tr>
235 - <th><?php _e('footer', 'usces'); ?></th>
236 - <td><textarea name="footer[ordermail]" id="footer[ordermail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['ordermail']); ?></textarea></td>
237 - <td>&nbsp;</td>
238 - </tr>
239 -</table>
240 -<hr size="1" color="#CCCCCC" />
241 -<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>
242 -</div>
243 -</div><!--postbox-->
244 -
245 -<div class="postbox">
246 -<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>
247 -<div class="inside">
248 -<table class="form_table">
249 - <tr>
250 - <th width="150"><?php _e('Title', 'usces'); ?></th>
251 - <td><input name="title[changemail]" id="title[changemail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['changemail']); ?>" /></td>
252 - <td>&nbsp;</td>
253 - </tr>
254 - <tr>
255 - <th><?php _e('header', 'usces'); ?></th>
256 - <td><textarea name="header[changemail]" id="header[changemail]" class="mail_header"><?php echo esc_html($mail_datas['header']['changemail']); ?></textarea></td>
257 - <td>&nbsp;</td>
258 - </tr>
259 - <tr>
260 - <th><?php _e('footer', 'usces'); ?></th>
261 - <td><textarea name="footer[changemail]" id="footer[changemail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['changemail']); ?></textarea></td>
262 - <td>&nbsp;</td>
263 - </tr>
264 -</table>
265 -<hr size="1" color="#CCCCCC" />
266 -<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>
267 -</div>
268 -</div><!--postbox-->
269 -
270 -<div class="postbox">
271 -<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>
272 -<div class="inside">
273 -<table class="form_table">
274 - <tr>
275 - <th width="150"><?php _e('Title', 'usces'); ?></th>
276 - <td><input name="title[receiptmail]" id="title[receiptmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['receiptmail']); ?>" /></td>
277 - <td>&nbsp;</td>
278 - </tr>
279 - <tr>
280 - <th><?php _e('header', 'usces'); ?></th>
281 - <td><textarea name="header[receiptmail]" id="header[receiptmail]" class="mail_header"><?php echo esc_html($mail_datas['header']['receiptmail']); ?></textarea></td>
282 - <td>&nbsp;</td>
283 - </tr>
284 - <tr>
285 - <th><?php _e('footer', 'usces'); ?></th>
286 - <td><textarea name="footer[receiptmail]" id="footer[receiptmail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['receiptmail']); ?></textarea></td>
287 - <td>&nbsp;</td>
288 - </tr>
289 -</table>
290 -<hr size="1" color="#CCCCCC" />
291 -<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>
292 -</div>
293 -</div><!--postbox-->
294 -
295 -<div class="postbox">
296 -<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>
297 -<div class="inside">
298 -<table class="form_table">
299 - <tr>
300 - <th width="150"><?php _e('Title', 'usces'); ?></th>
301 - <td><input name="title[mitumorimail]" id="title[mitumorimail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['mitumorimail']); ?>" /></td>
302 - <td>&nbsp;</td>
303 - </tr>
304 - <tr>
305 - <th><?php _e('header', 'usces'); ?></th>
306 - <td><textarea name="header[mitumorimail]" id="header[mitumorimail]" class="mail_header"><?php echo esc_html($mail_datas['header']['mitumorimail']); ?></textarea></td>
307 - <td>&nbsp;</td>
308 - </tr>
309 - <tr>
310 - <th><?php _e('footer', 'usces'); ?></th>
311 - <td><textarea name="footer[mitumorimail]" id="footer[mitumorimail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['mitumorimail']); ?></textarea></td>
312 - <td>&nbsp;</td>
313 - </tr>
314 -</table>
315 -<hr size="1" color="#CCCCCC" />
316 -<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>
317 -</div>
318 -</div><!--postbox-->
319 -
320 -<div class="postbox">
321 -<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>
322 -<div class="inside">
323 -<table class="form_table">
324 - <tr>
325 - <th width="150"><?php _e('Title', 'usces'); ?></th>
326 - <td><input name="title[cancelmail]" id="title[cancelmail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['cancelmail']); ?>" /></td>
327 - <td>&nbsp;</td>
328 - </tr>
329 - <tr>
330 - <th><?php _e('header', 'usces'); ?></th>
331 - <td><textarea name="header[cancelmail]" id="header[cancelmail]" class="mail_header"><?php echo esc_html($mail_datas['header']['cancelmail']); ?></textarea></td>
332 - <td>&nbsp;</td>
333 - </tr>
334 - <tr>
335 - <th><?php _e('footer', 'usces'); ?></th>
336 - <td><textarea name="footer[cancelmail]" id="footer[cancelmail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['cancelmail']); ?></textarea></td>
337 - <td>&nbsp;</td>
338 - </tr>
339 -</table>
340 -<hr size="1" color="#CCCCCC" />
341 -<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>
342 -</div>
343 -</div><!--postbox-->
344 -
345 -<div class="postbox">
346 -<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>
347 -<div class="inside">
348 -<table class="form_table">
349 - <tr>
350 - <th width="150"><?php _e('Title', 'usces'); ?></th>
351 - <td><input name="title[othermail]" id="title[othermail]" type="text" class="mail_title" value="<?php echo esc_attr($mail_datas['title']['othermail']); ?>" /></td>
352 - <td>&nbsp;</td>
353 - </tr>
354 - <tr>
355 - <th><?php _e('header', 'usces'); ?></th>
356 - <td><textarea name="header[othermail]" id="header[othermail]" class="mail_header"><?php echo esc_html($mail_datas['header']['othermail']); ?></textarea></td>
357 - <td>&nbsp;</td>
358 - </tr>
359 - <tr>
360 - <th><?php _e('footer', 'usces'); ?></th>
361 - <td><textarea name="footer[othermail]" id="footer[othermail]" class="mail_footer"><?php echo esc_html($mail_datas['footer']['othermail']); ?></textarea></td>
362 - <td>&nbsp;</td>
363 - </tr>
364 -</table>
365 -<hr size="1" color="#CCCCCC" />
366 -<div id="ex_othermail_mail" class="explanation"><?php _e('e-mail which will be sent on temporaly basis', 'usces'); ?></div>
367 -</div>
368 -</div><!--postbox-->
369 -
370 -<?php do_action( 'usces_action_admin_mailform' ); ?>
371 -
372 -
373 -</div><!--poststuff-->
374 -<input name="usces_option_update" type="submit" class="button" value="<?php _e('change decision','usces'); ?>" />
375 -</form>
376 -</div><!--usces_admin-->
377 -</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 } ?>