| @@ -1,0 +1,360 @@ | ||
| 1 | +<?php | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 4 | + | |
| 5 | +use AcyMailing\Helpers\CronHelper; | |
| 6 | + | |
| 7 | +?> | |
| 8 | + <div class="acym__content acym_area padding-vertical-1 padding-horizontal-2"> | |
| 9 | + <div class="acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_CONFIGURATION_QUEUE')); ?></div> | |
| 10 | + <div class="grid-x grid-margin-x margin-y"> | |
| 11 | + <div class="cell medium-3"><?php echo esc_html(acym_translation('ACYM_CONFIGURATION_QUEUE_PROCESSING')); ?></div> | |
| 12 | + <div class="cell medium-9"> | |
| 13 | + <?php | |
| 14 | + $disabledOptions = []; | |
| 15 | + if (!acym_level(ACYM_ESSENTIAL)) { | |
| 16 | + $disabledOptions = [ | |
| 17 | + 'auto' => ['tooltipTxt' => acym_translation('ACYM_PRO_ONLY'), 'disabledClass' => 'acym__disabled'], | |
| 18 | + 'automan' => ['tooltipTxt' => acym_translation('ACYM_PRO_ONLY'), 'disabledClass' => 'acym__disabled'], | |
| 19 | + ]; | |
| 20 | + } | |
| 21 | + acym_radio( | |
| 22 | + [ | |
| 23 | + 'auto' => acym_translation('ACYM_CONFIGURATION_QUEUE_AUTOMATIC'), | |
| 24 | + 'automan' => acym_translation('ACYM_CONFIGURATION_QUEUE_AUTOMAN'), | |
| 25 | + 'manual' => acym_translation('ACYM_CONFIGURATION_QUEUE_MANUAL'), | |
| 26 | + ], | |
| 27 | + 'config[queue_type]', | |
| 28 | + $this->config->get('queue_type', 'automan'), | |
| 29 | + [ | |
| 30 | + 'related' => [ | |
| 31 | + 'auto' => 'automatic_only', | |
| 32 | + 'automan' => 'automatic_manual', | |
| 33 | + 'manual' => 'manual_only', | |
| 34 | + ], | |
| 35 | + ], | |
| 36 | + [], | |
| 37 | + false, | |
| 38 | + $disabledOptions | |
| 39 | + ); | |
| 40 | + ?> | |
| 41 | + </div> | |
| 42 | + <div class="cell medium-3 automatic_only automatic_manual"> | |
| 43 | + <?php | |
| 44 | + echo esc_html(acym_translation('ACYM_AUTO_SEND_PROCESS')); | |
| 45 | + acym_info(['textShownInTooltip' => 'ACYM_AUTO_SEND_PROCESS_DESC']); | |
| 46 | + ?> | |
| 47 | + </div> | |
| 48 | + <div class="cell medium-9 grid-x automatic_only automatic_manual"> | |
| 49 | + <div class="cell large-9 grid-x margin-y"> | |
| 50 | + <div class="cell"> | |
| 51 | + <?php | |
| 52 | + $cronFrequency = (int)$this->config->get('cron_frequency'); | |
| 53 | + $valueBatch = acym_level(ACYM_ENTERPRISE) ? $this->config->get('queue_batch_auto', 1) : 1; | |
| 54 | + if (!function_exists('curl_multi_exec') && ($cronFrequency < 900 || intval($valueBatch) > 1)) { | |
| 55 | + acym_display(acym_translation('ACYM_MULTI_CURL_DISABLED'), 'error', false); | |
| 56 | + } elseif (empty($cronFrequency) && !empty($this->config->get('active_cron', 0))) { | |
| 57 | + acym_display(acym_translation('ACYM_EMPTY_FREQUENCY'), 'error', false); | |
| 58 | + } | |
| 59 | + | |
| 60 | + $disabledBatch = acym_level(ACYM_ENTERPRISE) ? '' : 'disabled'; | |
| 61 | + $delayTypeAuto = $data['typeDelay']; | |
| 62 | + $delayHtml = '<span data-acym-tooltip="'.esc_attr(acym_translation('ACYM_CRON_TRIGGERED_DESC')).'">'; | |
| 63 | + ob_start(); | |
| 64 | + $delayTypeAuto->display( | |
| 65 | + 'config[cron_frequency]', | |
| 66 | + $cronFrequency, | |
| 67 | + \AcyMailing\Types\DelayType::TYPE_MINUTES_HOURS, | |
| 68 | + '', | |
| 69 | + 'auto_sending_input' | |
| 70 | + ); | |
| 71 | + $delayHtml .= ob_get_clean().'</span>'; | |
| 72 | + echo wp_kses( | |
| 73 | + acym_translationSprintf( | |
| 74 | + 'ACYM_SEND_X_BATCH_OF_X_EMAILS_EVERY_Y', | |
| 75 | + '<input '.$disabledBatch.' class="intext_input auto_sending_input" type="number" min="1" max="10" name="config[queue_batch_auto]" value="'.intval( | |
| 76 | + $valueBatch | |
| 77 | + ).'" />', | |
| 78 | + '<input class="intext_input auto_sending_input" type="number" min="1" max="900" name="config[queue_nbmail_auto]" value="'.intval( | |
| 79 | + $this->config->get('queue_nbmail_auto') | |
| 80 | + ).'" />', | |
| 81 | + $delayHtml | |
| 82 | + ), | |
| 83 | + [ | |
| 84 | + 'input' => [ | |
| 85 | + 'disabled' => true, | |
| 86 | + 'class' => true, | |
| 87 | + 'type' => true, | |
| 88 | + 'min' => true, | |
| 89 | + 'max' => true, | |
| 90 | + 'name' => true, | |
| 91 | + 'value' => true, | |
| 92 | + 'onchange' => true, | |
| 93 | + 'id' => true, | |
| 94 | + ], | |
| 95 | + 'span' => [ | |
| 96 | + 'data-acym-tooltip' => true, | |
| 97 | + ], | |
| 98 | + 'select' => [ | |
| 99 | + 'class' => true, | |
| 100 | + 'onchange' => true, | |
| 101 | + 'name' => true, | |
| 102 | + 'id' => true, | |
| 103 | + ], | |
| 104 | + 'option' => [ | |
| 105 | + 'value' => true, | |
| 106 | + 'selected' => true, | |
| 107 | + ], | |
| 108 | + 'script' => [], | |
| 109 | + ] | |
| 110 | + ); | |
| 111 | + echo '<span id="automatic_sending_speed_too_many_batches">'; | |
| 112 | + acym_info(['textShownInTooltip' => 'ACYM_TOO_MANY_BATCHES', 'isWarning' => true]); | |
| 113 | + echo '</span>'; | |
| 114 | + ?> | |
| 115 | + </div> | |
| 116 | + <div class="cell"> | |
| 117 | + <?php | |
| 118 | + echo wp_kses( | |
| 119 | + acym_translationSprintf( | |
| 120 | + 'ACYM_WAIT_X_SECONDS_BETWEEN_MAILS', | |
| 121 | + '<input class="intext_input auto_sending_input" type="number" min="0" name="config[email_frequency]" value="'.esc_attr( | |
| 122 | + $this->config->get( | |
| 123 | + 'email_frequency', | |
| 124 | + 0 | |
| 125 | + ) | |
| 126 | + ).'" />' | |
| 127 | + ), | |
| 128 | + [ | |
| 129 | + 'input' => [ | |
| 130 | + 'class' => true, | |
| 131 | + 'type' => true, | |
| 132 | + 'min' => true, | |
| 133 | + 'name' => true, | |
| 134 | + 'value' => true, | |
| 135 | + ], | |
| 136 | + ] | |
| 137 | + ); | |
| 138 | + ?> | |
| 139 | + </div> | |
| 140 | + </div> | |
| 141 | + </div> | |
| 142 | + <div class="cell medium-3 automatic_only automatic_manual"></div> | |
| 143 | + <div class="cell medium-9 automatic_only automatic_manual margin-bottom-2"> | |
| 144 | + <?php echo wp_kses( | |
| 145 | + acym_translationSprintf('ACYM_SEND_X_EMAILS_PER_HOUR', '<span id="automatic_sending_speed_preview">280</span>'), | |
| 146 | + [ | |
| 147 | + 'span' => [ | |
| 148 | + 'id' => true, | |
| 149 | + ], | |
| 150 | + ] | |
| 151 | + ); ?> | |
| 152 | + <span id="automatic_sending_speed_too_much"> | |
| 153 | + <?php | |
| 154 | + acym_info( | |
| 155 | + [ | |
| 156 | + 'textShownInTooltip' => acym_translation('ACYM_ONE_SECOND_PER_EMAIL_WARNING'), | |
| 157 | + ] | |
| 158 | + ); | |
| 159 | + ?> | |
| 160 | + </span> | |
| 161 | + <span id="automatic_sending_speed_no_wait"> | |
| 162 | + <?php | |
| 163 | + acym_info( | |
| 164 | + [ | |
| 165 | + 'textShownInTooltip' => acym_translation('ACYM_SEND_FASTER_DECREASE_WAIT'), | |
| 166 | + ] | |
| 167 | + ); | |
| 168 | + ?> | |
| 169 | + </span> | |
| 170 | + </div> | |
| 171 | + <div class="cell medium-3 automatic_only automatic_manual"><?php echo esc_html(acym_translation('ACYM_SEND_RESTRICTIONS')); ?></div> | |
| 172 | + <div class="cell medium-9 grid-x margin-y automatic_only automatic_manual acym_auto_send_time"> | |
| 173 | + <div class="cell"> | |
| 174 | + <?php | |
| 175 | + $hoursFrom = acym_select( | |
| 176 | + $data['listHours'], | |
| 177 | + 'config[queue_send_from_hour]', | |
| 178 | + $this->config->get('queue_send_from_hour', '00'), | |
| 179 | + ['class' => 'intext_select'] | |
| 180 | + ); | |
| 181 | + $minutesFrom = acym_select( | |
| 182 | + $data['listAllMinutes'], | |
| 183 | + 'config[queue_send_from_minute]', | |
| 184 | + $this->config->get('queue_send_from_minute', '00'), | |
| 185 | + ['class' => 'intext_select'] | |
| 186 | + ); | |
| 187 | + $hoursTo = acym_select( | |
| 188 | + $data['listHours'], | |
| 189 | + 'config[queue_send_to_hour]', | |
| 190 | + $this->config->get('queue_send_to_hour', '23'), | |
| 191 | + ['class' => 'intext_select'] | |
| 192 | + ); | |
| 193 | + $minutesTo = acym_select( | |
| 194 | + $data['listAllMinutes'], | |
| 195 | + 'config[queue_send_to_minute]', | |
| 196 | + $this->config->get('queue_send_to_minute', '59'), | |
| 197 | + ['class' => 'intext_select'] | |
| 198 | + ); | |
| 199 | + echo wp_kses( | |
| 200 | + acym_translationSprintf('ACYM_SEND_FROM_TO', $hoursFrom, $minutesFrom, $hoursTo, $minutesTo), | |
| 201 | + [ | |
| 202 | + 'select' => [ | |
| 203 | + 'class' => true, | |
| 204 | + 'name' => true, | |
| 205 | + 'id' => true, | |
| 206 | + ], | |
| 207 | + 'option' => [ | |
| 208 | + 'value' => true, | |
| 209 | + 'selected' => true, | |
| 210 | + ], | |
| 211 | + ] | |
| 212 | + ); | |
| 213 | + ?> | |
| 214 | + </div> | |
| 215 | + <div class="cell grid-x"> | |
| 216 | + <div class="cell shrink margin-right-1"> | |
| 217 | + <?php echo esc_html(acym_translation('ACYM_DONT_SEND_WEEKEND')); ?> | |
| 218 | + </div> | |
| 219 | + <div class="cell shrink"> | |
| 220 | + <?php acym_switch(['name' => 'config[queue_stop_weekend]', 'value' => $this->config->get('queue_stop_weekend', 0)]); ?> | |
| 221 | + </div> | |
| 222 | + <div class="cell auto"></div> | |
| 223 | + </div> | |
| 224 | + </div> | |
| 225 | + <div class="cell medium-3 manual_only automatic_manual"><?php echo esc_html(acym_translation('ACYM_MANUAL_SEND_PROCESS')); ?></div> | |
| 226 | + <div class="cell medium-9 manual_only automatic_manual"> | |
| 227 | + <?php | |
| 228 | + echo wp_kses( | |
| 229 | + acym_translationSprintf( | |
| 230 | + 'ACYM_SEND_X_EMAILS_WAIT_Y_SECONDS', | |
| 231 | + '<input class="intext_input" type="number" min="1" name="config[queue_nbmail]" value="'.intval($this->config->get('queue_nbmail')).'" />', | |
| 232 | + '<input class="intext_input" type="number" min="0" name="config[queue_pause]" value="'.intval($this->config->get('queue_pause')).'" />' | |
| 233 | + ), | |
| 234 | + [ | |
| 235 | + 'input' => [ | |
| 236 | + 'class' => true, | |
| 237 | + 'type' => true, | |
| 238 | + 'min' => true, | |
| 239 | + 'name' => true, | |
| 240 | + 'value' => true, | |
| 241 | + ], | |
| 242 | + ] | |
| 243 | + ); | |
| 244 | + ?> | |
| 245 | + </div> | |
| 246 | + <div class="cell medium-3"><?php echo '<span>'.esc_html(acym_translation('ACYM_MAX_NB_TRY')).'</span>'; | |
| 247 | + acym_info(['textShownInTooltip' => 'ACYM_MAX_NB_TRY_DESC']); ?></div> | |
| 248 | + <div class="cell medium-9"> | |
| 249 | + <?php echo wp_kses( | |
| 250 | + acym_translationSprintf( | |
| 251 | + 'ACYM_CONFIG_TRY', | |
| 252 | + '<input class="intext_input" type="number" min="0" name="config[queue_try]" value="'.intval($this->config->get('queue_try')).'">' | |
| 253 | + ), | |
| 254 | + [ | |
| 255 | + 'input' => [ | |
| 256 | + 'class' => true, | |
| 257 | + 'type' => true, | |
| 258 | + 'min' => true, | |
| 259 | + 'name' => true, | |
| 260 | + 'value' => true, | |
| 261 | + ], | |
| 262 | + ] | |
| 263 | + ); | |
| 264 | + | |
| 265 | + $failaction = $data['failaction']; | |
| 266 | + echo ' '.wp_kses( | |
| 267 | + acym_translationSprintf('ACYM_CONFIG_TRY_ACTION', $failaction->display('maxtry', $this->config->get('bounce_action_maxtry', 'noaction'))), | |
| 268 | + [ | |
| 269 | + 'select' => [ | |
| 270 | + 'class' => true, | |
| 271 | + 'style' => true, | |
| 272 | + 'onchange' => true, | |
| 273 | + 'name' => true, | |
| 274 | + 'id' => true, | |
| 275 | + ], | |
| 276 | + 'option' => [ | |
| 277 | + 'value' => true, | |
| 278 | + 'selected' => true, | |
| 279 | + ], | |
| 280 | + 'span' => [ | |
| 281 | + 'id' => true, | |
| 282 | + 'style' => true, | |
| 283 | + ], | |
| 284 | + ] | |
| 285 | + ); ?> | |
| 286 | + </div> | |
| 287 | + <div class="cell medium-3"> | |
| 288 | + <?php | |
| 289 | + echo esc_html(acym_translation('ACYM_NUMBER_OF_DAYS_TO_CLEAN_QUEUE')); | |
| 290 | + acym_info( | |
| 291 | + [ | |
| 292 | + 'textShownInTooltip' => 'ACYM_NUMBER_OF_DAYS_TO_CLEAN_QUEUE_DESC', | |
| 293 | + ] | |
| 294 | + ); | |
| 295 | + ?> | |
| 296 | + </div> | |
| 297 | + <div class="cell medium-9 grid-x"> | |
| 298 | + <div class="cell medium-6 large-4 xlarge-3 xxlarge-2"> | |
| 299 | + <?php | |
| 300 | + $queueDelete = $this->config->get('queue_delete_days', 0); | |
| 301 | + if (!acym_level(ACYM_ESSENTIAL)) { | |
| 302 | + $inputContent = '<input type="number" class="intext_input" disabled min="0" name="config[queue_delete_days]" value="'.esc_attr($queueDelete).'">'; | |
| 303 | + acym_tooltip( | |
| 304 | + [ | |
| 305 | + 'hoveredText' => $inputContent, | |
| 306 | + 'textShownInTooltip' => acym_translation('ACYM_PRO_ONLY'), | |
| 307 | + ] | |
| 308 | + ); | |
| 309 | + } else { | |
| 310 | + echo '<input type="number" class="intext_input" min="0" name="config[queue_delete_days]" value="'.esc_attr($queueDelete).'">'; | |
| 311 | + } | |
| 312 | + ?> | |
| 313 | + </div> | |
| 314 | + </div> | |
| 315 | + <div class="cell medium-3"> | |
| 316 | + <?php | |
| 317 | + echo esc_html(acym_translation('ACYM_RECORD_STATS_EACH_EMAIL')); | |
| 318 | + acym_info(['textShownInTooltip' => 'ACYM_RECORD_STATS_EACH_EMAIL_DESC']); ?> | |
| 319 | + </div> | |
| 320 | + <div class="cell medium-9 grid-x"> | |
| 321 | + <div class="cell medium-6 large-4 xlarge-3 xxlarge-2"> | |
| 322 | + <?php acym_switch(['name' => 'config[queue_statistics_by_batch]', 'value' => $this->config->get('queue_statistics_by_batch', 1)]); ?> | |
| 323 | + </div> | |
| 324 | + </div> | |
| 325 | + <?php if (acym_level(ACYM_ENTERPRISE)) { ?> | |
| 326 | + <div class="cell medium-3"> | |
| 327 | + <?php | |
| 328 | + echo esc_html(acym_translation('ACYM_SET_FOLLOWUP_PRIORITY')); | |
| 329 | + acym_info(['textShownInTooltip' => 'ACYM_SET_FOLLOWUP_PRIORITY_DESC']); ?> | |
| 330 | + </div> | |
| 331 | + <div class="cell medium-9 grid-x"> | |
| 332 | + <div class="cell medium-6 large-4 xlarge-3 xxlarge-2"> | |
| 333 | + <?php acym_switch(['name' => 'config[followup_max_priority]', 'value' => $this->config->get('followup_max_priority', 0)]); ?> | |
| 334 | + </div> | |
| 335 | + </div> | |
| 336 | + <div class="cell medium-3 automatic_only automatic_manual"> | |
| 337 | + <?php | |
| 338 | + echo esc_html(acym_translation('ACYM_USE_DEDICATED_SENDING_PROCESS')); | |
| 339 | + acym_info(['textShownInTooltip' => 'ACYM_USE_DEDICATED_SENDING_PROCESS_DESC']); ?> | |
| 340 | + </div> | |
| 341 | + <div class="cell medium-9 grid-x automatic_only automatic_manual"> | |
| 342 | + <div class="cell medium-6 large-4 xlarge-3 xxlarge-2"> | |
| 343 | + <?php | |
| 344 | + acym_switch([ | |
| 345 | + 'name' => 'config[dedicated_send_process]', | |
| 346 | + 'value' => $this->config->get('dedicated_send_process', 0), | |
| 347 | + ]); | |
| 348 | + ?> | |
| 349 | + </div> | |
| 350 | + </div> | |
| 351 | + <?php } ?> | |
| 352 | + </div> | |
| 353 | + </div> | |
| 354 | +<?php | |
| 355 | +if (!acym_level(ACYM_ESSENTIAL)) { | |
| 356 | + echo '<div class="acym_area"> | |
| 357 | + <div class="acym__title acym__title__secondary">'.esc_html(acym_translation('ACYM_CRON')).'</div>'; | |
| 358 | + include acym_getView('configuration', 'upgrade_license'); | |
| 359 | + echo '</div>'; | |
| 360 | +} | |