| 1 |
<?php |
| 2 |
/** |
| 3 |
* View notification settings |
| 4 |
* |
| 5 |
* @package |
| 6 |
*/ |
| 7 |
?> |
| 8 |
<div class="settings-tab-container"> |
| 9 |
<ul class="wpfnl-general-settings-tab-nav"> |
| 10 |
<li class="inner-tab active" data-tab="tab-revenue-report"><?php esc_html_e('Store Revenue Report', 'wpfnl'); ?></li> |
| 11 |
</ul> |
| 12 |
</div> |
| 13 |
|
| 14 |
<!-- Tab: Store Revenue Report --> |
| 15 |
<div class="wpfnl-tab-content active" id="tab-revenue-report"> |
| 16 |
<div class="wpfnl-box revenue-report-notification"> |
| 17 |
|
| 18 |
<div class="wpfnl-box"> |
| 19 |
<div class="wpfnl-field-wrapper"> |
| 20 |
<label> |
| 21 |
<?php esc_html_e('Enable Store Revenue Report Emails', 'wpfnl'); ?> |
| 22 |
<span class="wpfnl-tooltip"> |
| 23 |
<?php require WPFNL_DIR . '/admin/partials/icons/settings-tooltip-icon.php'; ?> |
| 24 |
<p><?php esc_html_e('Enable or disable automated store revenue report emails.', 'wpfnl'); ?></p> |
| 25 |
</span> |
| 26 |
</label> |
| 27 |
|
| 28 |
<div class="wpfnl-fields"> |
| 29 |
<span class="wpfnl-switcher extra-sm no-title"> |
| 30 |
<input |
| 31 |
type="checkbox" |
| 32 |
name="wpfnl-enable-revenue-report" |
| 33 |
id="wpfnl-enable-revenue-report" |
| 34 |
<?php checked('yes', isset($this->notification_settings['enable_revenue_report']) ? $this->notification_settings['enable_revenue_report'] : 'no'); ?> |
| 35 |
/> |
| 36 |
<label for="wpfnl-enable-revenue-report"></label> |
| 37 |
</span> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
|
| 42 |
<div class="wpfnl-revenue-report-settings-outer" id="wpfnl-revenue-report-settings"> |
| 43 |
|
| 44 |
<div class="wpfnl-box"> |
| 45 |
<div class="wpfnl-revenue-report-settings"> |
| 46 |
|
| 47 |
<div class="wpfnl-field-wrapper report-frequency"> |
| 48 |
<label> |
| 49 |
<?php esc_html_e('Report Frequency', 'wpfnl'); ?> |
| 50 |
<span class="wpfnl-tooltip"> |
| 51 |
<?php require WPFNL_DIR . '/admin/partials/icons/settings-tooltip-icon.php'; ?> |
| 52 |
<p><?php esc_html_e('Select how often you want to receive revenue reports.', 'wpfnl'); ?></p> |
| 53 |
</span> |
| 54 |
</label> |
| 55 |
|
| 56 |
<div class="wpfnl-fields"> |
| 57 |
<div class="wpfnl-radio-wrapper"> |
| 58 |
<label class="wpfnl-radio-field"> |
| 59 |
<input |
| 60 |
type="radio" |
| 61 |
name="wpfnl-revenue-report-frequency" |
| 62 |
value="weekly" |
| 63 |
<?php checked('weekly', isset($this->notification_settings['revenue_report_frequency']) ? $this->notification_settings['revenue_report_frequency'] : 'weekly'); ?> |
| 64 |
/> |
| 65 |
<span><?php esc_html_e('Weekly', 'wpfnl'); ?></span> |
| 66 |
</label> |
| 67 |
|
| 68 |
<label class="wpfnl-radio-field"> |
| 69 |
<input |
| 70 |
type="radio" |
| 71 |
name="wpfnl-revenue-report-frequency" |
| 72 |
value="monthly" |
| 73 |
<?php checked('monthly', isset($this->notification_settings['revenue_report_frequency']) ? $this->notification_settings['revenue_report_frequency'] : 'weekly'); ?> |
| 74 |
/> |
| 75 |
<span><?php esc_html_e('Monthly', 'wpfnl'); ?></span> |
| 76 |
</label> |
| 77 |
</div> |
| 78 |
</div> |
| 79 |
</div> |
| 80 |
|
| 81 |
<div class="wpfnl-field-wrapper"> |
| 82 |
<label> |
| 83 |
<?php esc_html_e('Recipient Email Address', 'wpfnl'); ?> |
| 84 |
<span class="wpfnl-tooltip"> |
| 85 |
<?php require WPFNL_DIR . '/admin/partials/icons/settings-tooltip-icon.php'; ?> |
| 86 |
<p><?php esc_html_e('Enter the email address where you want to receive store revenue reports. You can add multiple emails separated by commas.', 'wpfnl'); ?></p> |
| 87 |
</span> |
| 88 |
</label> |
| 89 |
<div class="wpfnl-fields"> |
| 90 |
<input |
| 91 |
type="text" |
| 92 |
name="wpfnl-revenue-report-recipient" |
| 93 |
id="wpfnl-revenue-report-recipient" |
| 94 |
value="<?php echo isset($this->notification_settings['revenue_report_recipient']) ? sanitize_text_field($this->notification_settings['revenue_report_recipient']) : get_option('admin_email'); ?>" |
| 95 |
placeholder="<?php esc_attr_e('admin@example.com, manager@example.com', 'wpfnl'); ?>" |
| 96 |
/> |
| 97 |
</div> |
| 98 |
</div> |
| 99 |
|
| 100 |
<div class="wpfnl-field-wrapper"> |
| 101 |
<label> |
| 102 |
<?php esc_html_e('Report Subject', 'wpfnl'); ?> |
| 103 |
<span class="wpfnl-tooltip"> |
| 104 |
<?php require WPFNL_DIR . '/admin/partials/icons/settings-tooltip-icon.php'; ?> |
| 105 |
<p><?php esc_html_e('Customize the subject line for your revenue report emails.', 'wpfnl'); ?></p> |
| 106 |
</span> |
| 107 |
</label> |
| 108 |
<div class="wpfnl-fields"> |
| 109 |
<input |
| 110 |
type="text" |
| 111 |
name="wpfnl-revenue-report-subject" |
| 112 |
id="wpfnl-revenue-report-subject" |
| 113 |
value="<?php echo isset($this->notification_settings['revenue_report_subject']) ? sanitize_text_field($this->notification_settings['revenue_report_subject']) : 'Store Revenue Report - {period}'; ?>" |
| 114 |
placeholder="<?php esc_attr_e('Store Revenue Report - {period}', 'wpfnl'); ?>" |
| 115 |
/> |
| 116 |
<p class="hints"><?php esc_html_e('Use {period} to show the date range (e.g., January 6, 2026 - January 12, 2026)', 'wpfnl'); ?></p> |
| 117 |
</div> |
| 118 |
</div> |
| 119 |
|
| 120 |
<div class="wpfnl-field-wrapper"> |
| 121 |
<label> |
| 122 |
<?php esc_html_e('Send Time', 'wpfnl'); ?> |
| 123 |
<span class="wpfnl-tooltip"> |
| 124 |
<?php require WPFNL_DIR . '/admin/partials/icons/settings-tooltip-icon.php'; ?> |
| 125 |
<p><?php esc_html_e('Select the time when you want to receive the revenue report emails.', 'wpfnl'); ?></p> |
| 126 |
</span> |
| 127 |
</label> |
| 128 |
<div class="wpfnl-fields"> |
| 129 |
<?php |
| 130 |
$send_time = isset($this->notification_settings['send_time']) ? $this->notification_settings['send_time'] : '10:00'; |
| 131 |
?> |
| 132 |
<input |
| 133 |
type="time" |
| 134 |
name="wpfnl-send-time" |
| 135 |
id="wpfnl-send-time" |
| 136 |
value="<?php echo esc_attr($send_time); ?>" |
| 137 |
class="wpfnl-time-input" |
| 138 |
/> |
| 139 |
</div> |
| 140 |
</div> |
| 141 |
|
| 142 |
</div> |
| 143 |
<!-- /wpfnl-revenue-report-settings --> |
| 144 |
</div> |
| 145 |
<!-- /wpfnl-box --> |
| 146 |
|
| 147 |
<!-- Test Notification Section --> |
| 148 |
<div class="wpfnl-box test-notification-wrapper"> |
| 149 |
<div class="wpfnl-field-wrapper"> |
| 150 |
<div class="test-notification-content"> |
| 151 |
<div class="test-notification-icon"> |
| 152 |
<svg width="48" height="48" viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="icon-email-deliver"><path id="Shape" d="M44.5 16.4211C44.5 22.1764 39.8097 26.8421 34.0238 26.8421C28.238 26.8421 23.5476 22.1764 23.5476 16.4211C23.5476 10.6657 28.238 6 34.0238 6C39.8097 6 44.5 10.6657 44.5 16.4211ZM33.0714 13.024V22.1053C33.0714 22.6285 33.4978 23.0526 34.0238 23.0526C34.5498 23.0526 34.9762 22.6285 34.9762 22.1053V13.024L38.1123 16.1436C38.4842 16.5135 39.0872 16.5135 39.4591 16.1436C39.8311 15.7736 39.8311 15.1738 39.4591 14.8038L34.6972 10.067C34.3253 9.69698 33.7223 9.69698 33.3504 10.067L28.5885 14.8038C28.2165 15.1738 28.2165 15.7736 28.5885 16.1436C28.9604 16.5135 29.5634 16.5135 29.9353 16.1436L33.0714 13.024ZM39.7381 35.8421V27.3495C40.7877 26.8054 41.749 26.116 42.5952 25.3082V35.8421C42.5952 39.1257 40.0114 41.809 36.756 41.9903L36.4048 42H10.6905C7.38947 42 4.6919 39.4298 4.50979 36.1915L4.5 35.8421V17.8421C4.5 14.5585 7.08371 11.8751 10.3392 11.6939L10.6905 11.6842H22.5917C22.2151 12.5826 21.9424 13.535 21.7885 14.5263H10.6905C8.94158 14.5263 7.50726 15.8661 7.36819 17.5702L7.35714 17.8421V18.6549L23.5476 27.1311L26.0337 25.8292C26.869 26.5319 27.7991 27.1264 28.8022 27.5912L24.213 29.9944C23.856 30.1812 23.4392 30.2079 23.0653 30.0745L22.8823 29.9944L7.35714 21.8665V35.8421C7.35714 37.5819 8.70402 39.0086 10.4171 39.1469L10.6905 39.1579H36.4048C38.1537 39.1579 39.588 37.8181 39.727 36.114L39.7381 35.8421Z" fill="#353030"></path></g></svg> |
| 153 |
</div> |
| 154 |
<div class="test-notification-text"> |
| 155 |
<h4><?php esc_html_e('Test Notification', 'wpfnl'); ?></h4> |
| 156 |
<p><?php esc_html_e('Test the notifications to ensure that emails are arriving in your inbox.', 'wpfnl'); ?></p> |
| 157 |
</div> |
| 158 |
</div> |
| 159 |
<div class="test-notification-action"> |
| 160 |
<input |
| 161 |
type="email" |
| 162 |
name="wpfnl-test-notification-email" |
| 163 |
id="wpfnl-test-notification-email" |
| 164 |
placeholder="<?php esc_attr_e('dev@test.com', 'wpfnl'); ?>" |
| 165 |
value="<?php echo esc_attr(get_option('admin_email')); ?>" |
| 166 |
class="wpfnl-test-email-input" |
| 167 |
/> |
| 168 |
<button type="button" class="btn-default" id="wpfnl-send-test-notification"> |
| 169 |
<?php esc_html_e('Send', 'wpfnl'); ?> |
| 170 |
<span class="wpfnl-loader"></span> |
| 171 |
</button> |
| 172 |
</div> |
| 173 |
</div> |
| 174 |
</div> |
| 175 |
<!-- /test-notification-wrapper --> |
| 176 |
|
| 177 |
</div> |
| 178 |
<!-- /wpfnl-revenue-report-settings-outer --> |
| 179 |
|
| 180 |
</div> |
| 181 |
</div> |
| 182 |
|