/** * 予約完了メールフォーム出力データ * */ private function _out_mailform($booking, $article) { global $mts_simple_booking; // テンプレート番号取得、設定されていなければNULLを戻す $tno = $article['addition']->template; if (!$article['addition']->template) { return null; } $template = new MTSSB_Mail_Template(); $template->get_mail_template($tno); // メールオブジェクト $mts_simple_booking->_load_module('MTSSB_Mail'); // テンプレートの変数置換 $subject = $template->mail_subject; $body = $mts_simple_booking->oMail->replace_variables($template->mail_body); ob_start(); ?> <div class="mtssb-dialog-inner"> <form id="check-mail-form"> <div class="mail-infield"> <label for="check-mail-subject">件名:</label> <input id="check-mail-subject" type="text" name="mail_subject" value="<?php echo $subject; ?> "> </div> <div class="mail-infield"> <label for="check-mail-body">内容:</label> <textarea id="check-mail-body" name="mail_body" rows="10"><?php echo $body; ?> </textarea> </div> <input type="hidden" id="check-mail-booking-id" name="booking_id" value="<?php echo $booking['booking_id']; ?> "> </form> </div> <?php return ob_get_clean(); }
/** * 予約処理の各種設定 * */ public function meta_box_miscellaneous($post) { $article = $this->article; $option_catalog = get_option($this->domain . MTS_Simple_booking::CATALOG_NAME); $limit = $this->_get_cancel_margin(); $booking_mail = $article['addition']->booking_mail; $bookingmail = empty($booking_mail) ? '' : $booking_mail[0]; // 予約確認メールテンプレートオブジェクトリストを取得する $templates = MTSSB_Mail_Template::list_all(); ob_start(); ?> <input type="hidden" name="<?php echo $this->nonce_name; ?> " value="<?php echo wp_create_nonce($this->module_name); ?> " /> <table class="form-table"> <tr> <th scope="row"><label for="article-addition-option"><?php _e('Option Settings', $this->domain); ?> </label></th> <td> <input type="hidden" name="article[addition][option]" value="0" /><input type="checkbox" id="article-addition-option" name="article[addition][option]" value="1" <?php echo $article['addition']->isOption() ? 'checked="checked" ' : ''; ?> /> <p class="article-description"><?php _e('Selection of whether to use an additional option.', $this->domain); ?> </p> </td> </tr> <tr> <th scope="row"><label for="article-addition-option_name"><?php _e('Option Name', $this->domain); ?> </label></th> <td> <select id="article-addition-option_name" name="article[addition][option_name]" style="letter-spacing:1px"> <option value=""><?php _e('Select option', $this->domain); ?> </option> <?php foreach ($option_catalog as $catalog_name => $catalog_title) { ?> <option value="<?php echo $catalog_name; ?> "<?php echo $catalog_name == $article['addition']->option_name ? ' selected="selected"' : ''; ?> ><?php echo $catalog_title; ?> </option> <?php } ?> </select> <p class="article-description"><?php _e('Select a option group for this article.', $this->domain); ?> </p> </td> </tr> <tr> <th scope="row"><label for="article-addition-cancel_limit"><?php _e('Cancel Limit Date', $this->domain); ?> </label></th> <td> <select id="article-addition-cancel_limit" name="article[addition][cancel_limit]" style="letter-spacing:1px"><?php foreach ($limit as $min => $label) { ?> <option value="<?php echo $min; ?> "<?php echo $min == $article['addition']->cancel_limit ? ' selected="selected"' : ''; ?> ><?php echo $label; ?> </option> <?php } ?> </select> <?php _e('before', $this->domain); ?> <br /> <p class="article-description"><?php _e('Limited time to be able to accept canceling except unavailable.', $this->domain); ?> </p> </td> </tr> <tr> <th scope="row"><label for="article-addition-position"><?php _e('Position Of The Option', $this->domain); ?> </label></th> <td> <select id="article-addition-position" name="article[addition][position]" style="letter-spacing:1px"> <option value="0"<?php echo $article['addition']->position == 0 ? ' selected="selected"' : ''; ?> ><?php _e('Before', $this->domain); ?> </option> <option value="1"<?php echo $article['addition']->position == 1 ? ' selected="selected"' : ''; ?> ><?php _e('After', $this->domain); ?> </option> </select> <p class="article-description"><?php _e("Select the position of the option's field on a booking form page.", $this->domain); ?> </p> </td> </tr> <tr> <th scope="row"><label for="article-addition-bookingmail"><?php _e('Auto Booking Mail Address', $this->domain); ?> </label></th> <td> <input type="text" id="article-addition-bookingmail" class="mts-fat" name="article[addition][booking_mail][0]" value="<?php echo esc_html($bookingmail); ?> " /> <p class="article-description"><?php _e("Set auto booking mail address when sending to the different address from the settings.", $this->domain); ?> </p> </td> </tr> <tr> <th scope="row"><label for="article-addition-template"><?php _e('Confirmation Mail', $this->domain); ?> </label></th> <td> <select id="article-addition-template" name="article[addition][template]" style="letter-spacing:1px"> <option value=""><?php _e('Not send', $this->domain); ?> </option> <?php if ($templates) { foreach ($templates as $template) { ?> <option value="<?php echo $template->template_number(); ?> "<?php echo $article['addition']->template == $template->template_number() ? ' selected="selected"' : ''; ?> ><?php echo $template->mail_subject; ?> </option> <?php } } ?> </select><br /> <p class="article-description"><?php _e('Select a template for a sending confirmation mail.', $this->domain); ?> </p> </td> </tr> <tr> <th scope="row"><label for="article-addition-tracking"><?php _e('Tracking Code', $this->domain); ?> </label></th> <td> <input type="text" id="article-addition-tracking" class="mts-fat" name="article[addition][tracking]" value="<?php echo esc_html($article['addition']->tracking); ?> " /> <p class="article-description"><?php _e("Set tracking code when using affiliate. It's able to use %RESERVE_ID%.", $this->domain); ?> </p> </td> </tr> </table> <?php ob_end_flush(); }