| 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 |
'id' => true, |
| 93 |
], |
| 94 |
'span' => [ |
| 95 |
'data-acym-tooltip' => true, |
| 96 |
], |
| 97 |
'select' => [ |
| 98 |
'class' => true, |
| 99 |
'name' => true, |
| 100 |
'id' => true, |
| 101 |
], |
| 102 |
'option' => [ |
| 103 |
'value' => true, |
| 104 |
'selected' => true, |
| 105 |
], |
| 106 |
] |
| 107 |
); |
| 108 |
echo '<span id="automatic_sending_speed_too_many_batches">'; |
| 109 |
acym_info(['textShownInTooltip' => 'ACYM_TOO_MANY_BATCHES', 'isWarning' => true]); |
| 110 |
echo '</span>'; |
| 111 |
?> |
| 112 |
</div> |
| 113 |
<div class="cell"> |
| 114 |
<?php |
| 115 |
echo wp_kses( |
| 116 |
acym_translationSprintf( |
| 117 |
'ACYM_WAIT_X_SECONDS_BETWEEN_MAILS', |
| 118 |
'<input class="intext_input auto_sending_input" type="number" min="0" name="config[email_frequency]" value="'.esc_attr( |
| 119 |
$this->config->get( |
| 120 |
'email_frequency', |
| 121 |
0 |
| 122 |
) |
| 123 |
).'" />' |
| 124 |
), |
| 125 |
[ |
| 126 |
'input' => [ |
| 127 |
'class' => true, |
| 128 |
'type' => true, |
| 129 |
'min' => true, |
| 130 |
'name' => true, |
| 131 |
'value' => true, |
| 132 |
], |
| 133 |
] |
| 134 |
); |
| 135 |
?> |
| 136 |
</div> |
| 137 |
</div> |
| 138 |
</div> |
| 139 |
<div class="cell medium-3 automatic_only automatic_manual"></div> |
| 140 |
<div class="cell medium-9 automatic_only automatic_manual margin-bottom-2"> |
| 141 |
<?php echo wp_kses( |
| 142 |
acym_translationSprintf('ACYM_SEND_X_EMAILS_PER_HOUR', '<span id="automatic_sending_speed_preview">280</span>'), |
| 143 |
[ |
| 144 |
'span' => [ |
| 145 |
'id' => true, |
| 146 |
], |
| 147 |
] |
| 148 |
); ?> |
| 149 |
<span id="automatic_sending_speed_too_much"> |
| 150 |
<?php |
| 151 |
acym_info( |
| 152 |
[ |
| 153 |
'textShownInTooltip' => acym_translation('ACYM_ONE_SECOND_PER_EMAIL_WARNING'), |
| 154 |
] |
| 155 |
); |
| 156 |
?> |
| 157 |
</span> |
| 158 |
<span id="automatic_sending_speed_no_wait"> |
| 159 |
<?php |
| 160 |
acym_info( |
| 161 |
[ |
| 162 |
'textShownInTooltip' => acym_translation('ACYM_SEND_FASTER_DECREASE_WAIT'), |
| 163 |
] |
| 164 |
); |
| 165 |
?> |
| 166 |
</span> |
| 167 |
</div> |
| 168 |
<div class="cell medium-3 automatic_only automatic_manual"><?php echo esc_html(acym_translation('ACYM_SEND_RESTRICTIONS')); ?></div> |
| 169 |
<div class="cell medium-9 grid-x margin-y automatic_only automatic_manual acym_auto_send_time"> |
| 170 |
<div class="cell"> |
| 171 |
<?php |
| 172 |
$hoursFrom = acym_select( |
| 173 |
$data['listHours'], |
| 174 |
'config[queue_send_from_hour]', |
| 175 |
$this->config->get('queue_send_from_hour', '00'), |
| 176 |
['class' => 'intext_select'] |
| 177 |
); |
| 178 |
$minutesFrom = acym_select( |
| 179 |
$data['listAllMinutes'], |
| 180 |
'config[queue_send_from_minute]', |
| 181 |
$this->config->get('queue_send_from_minute', '00'), |
| 182 |
['class' => 'intext_select'] |
| 183 |
); |
| 184 |
$hoursTo = acym_select( |
| 185 |
$data['listHours'], |
| 186 |
'config[queue_send_to_hour]', |
| 187 |
$this->config->get('queue_send_to_hour', '23'), |
| 188 |
['class' => 'intext_select'] |
| 189 |
); |
| 190 |
$minutesTo = acym_select( |
| 191 |
$data['listAllMinutes'], |
| 192 |
'config[queue_send_to_minute]', |
| 193 |
$this->config->get('queue_send_to_minute', '59'), |
| 194 |
['class' => 'intext_select'] |
| 195 |
); |
| 196 |
echo wp_kses( |
| 197 |
acym_translationSprintf('ACYM_SEND_FROM_TO', $hoursFrom, $minutesFrom, $hoursTo, $minutesTo), |
| 198 |
[ |
| 199 |
'select' => [ |
| 200 |
'class' => true, |
| 201 |
'name' => true, |
| 202 |
'id' => true, |
| 203 |
], |
| 204 |
'option' => [ |
| 205 |
'value' => true, |
| 206 |
'selected' => true, |
| 207 |
], |
| 208 |
] |
| 209 |
); |
| 210 |
?> |
| 211 |
</div> |
| 212 |
<div class="cell grid-x"> |
| 213 |
<div class="cell shrink margin-right-1"> |
| 214 |
<?php echo esc_html(acym_translation('ACYM_DONT_SEND_WEEKEND')); ?> |
| 215 |
</div> |
| 216 |
<div class="cell shrink"> |
| 217 |
<?php acym_switch(['name' => 'config[queue_stop_weekend]', 'value' => $this->config->get('queue_stop_weekend', 0)]); ?> |
| 218 |
</div> |
| 219 |
<div class="cell auto"></div> |
| 220 |
</div> |
| 221 |
</div> |
| 222 |
<div class="cell medium-3 manual_only automatic_manual"><?php echo esc_html(acym_translation('ACYM_MANUAL_SEND_PROCESS')); ?></div> |
| 223 |
<div class="cell medium-9 manual_only automatic_manual"> |
| 224 |
<?php |
| 225 |
echo wp_kses( |
| 226 |
acym_translationSprintf( |
| 227 |
'ACYM_SEND_X_EMAILS_WAIT_Y_SECONDS', |
| 228 |
'<input class="intext_input" type="number" min="1" name="config[queue_nbmail]" value="'.intval($this->config->get('queue_nbmail')).'" />', |
| 229 |
'<input class="intext_input" type="number" min="0" name="config[queue_pause]" value="'.intval($this->config->get('queue_pause')).'" />' |
| 230 |
), |
| 231 |
[ |
| 232 |
'input' => [ |
| 233 |
'class' => true, |
| 234 |
'type' => true, |
| 235 |
'min' => true, |
| 236 |
'name' => true, |
| 237 |
'value' => true, |
| 238 |
], |
| 239 |
] |
| 240 |
); |
| 241 |
?> |
| 242 |
</div> |
| 243 |
<div class="cell medium-3"><?php echo '<span>'.esc_html(acym_translation('ACYM_MAX_NB_TRY')).'</span>'; |
| 244 |
acym_info(['textShownInTooltip' => 'ACYM_MAX_NB_TRY_DESC']); ?></div> |
| 245 |
<div class="cell medium-9"> |
| 246 |
<?php echo wp_kses( |
| 247 |
acym_translationSprintf( |
| 248 |
'ACYM_CONFIG_TRY', |
| 249 |
'<input class="intext_input" type="number" min="0" name="config[queue_try]" value="'.intval($this->config->get('queue_try')).'">' |
| 250 |
), |
| 251 |
[ |
| 252 |
'input' => [ |
| 253 |
'class' => true, |
| 254 |
'type' => true, |
| 255 |
'min' => true, |
| 256 |
'name' => true, |
| 257 |
'value' => true, |
| 258 |
], |
| 259 |
] |
| 260 |
); |
| 261 |
|
| 262 |
$failaction = $data['failaction']; |
| 263 |
echo ' '.wp_kses( |
| 264 |
acym_translationSprintf('ACYM_CONFIG_TRY_ACTION', $failaction->display('maxtry', $this->config->get('bounce_action_maxtry', 'noaction'))), |
| 265 |
[ |
| 266 |
'select' => [ |
| 267 |
'class' => true, |
| 268 |
'style' => true, |
| 269 |
'onchange' => true, |
| 270 |
'name' => true, |
| 271 |
'id' => true, |
| 272 |
], |
| 273 |
'option' => [ |
| 274 |
'value' => true, |
| 275 |
'selected' => true, |
| 276 |
], |
| 277 |
'span' => [ |
| 278 |
'id' => true, |
| 279 |
'style' => true, |
| 280 |
], |
| 281 |
] |
| 282 |
); ?> |
| 283 |
</div> |
| 284 |
<div class="cell medium-3"> |
| 285 |
<?php |
| 286 |
echo esc_html(acym_translation('ACYM_NUMBER_OF_DAYS_TO_CLEAN_QUEUE')); |
| 287 |
acym_info( |
| 288 |
[ |
| 289 |
'textShownInTooltip' => 'ACYM_NUMBER_OF_DAYS_TO_CLEAN_QUEUE_DESC', |
| 290 |
] |
| 291 |
); |
| 292 |
?> |
| 293 |
</div> |
| 294 |
<div class="cell medium-9 grid-x"> |
| 295 |
<div class="cell medium-6 large-4 xlarge-3 xxlarge-2"> |
| 296 |
<?php |
| 297 |
$queueDelete = $this->config->get('queue_delete_days', 0); |
| 298 |
if (!acym_level(ACYM_ESSENTIAL)) { |
| 299 |
$inputContent = '<input type="number" class="intext_input" disabled min="0" name="config[queue_delete_days]" value="'.esc_attr($queueDelete).'">'; |
| 300 |
acym_tooltip( |
| 301 |
[ |
| 302 |
'hoveredText' => $inputContent, |
| 303 |
'textShownInTooltip' => acym_translation('ACYM_PRO_ONLY'), |
| 304 |
] |
| 305 |
); |
| 306 |
} else { |
| 307 |
echo '<input type="number" class="intext_input" min="0" name="config[queue_delete_days]" value="'.esc_attr($queueDelete).'">'; |
| 308 |
} |
| 309 |
?> |
| 310 |
</div> |
| 311 |
</div> |
| 312 |
<div class="cell medium-3"> |
| 313 |
<?php |
| 314 |
echo esc_html(acym_translation('ACYM_RECORD_STATS_EACH_EMAIL')); |
| 315 |
acym_info(['textShownInTooltip' => 'ACYM_RECORD_STATS_EACH_EMAIL_DESC']); ?> |
| 316 |
</div> |
| 317 |
<div class="cell medium-9 grid-x"> |
| 318 |
<div class="cell medium-6 large-4 xlarge-3 xxlarge-2"> |
| 319 |
<?php acym_switch(['name' => 'config[queue_statistics_by_batch]', 'value' => $this->config->get('queue_statistics_by_batch', 1)]); ?> |
| 320 |
</div> |
| 321 |
</div> |
| 322 |
<?php if (acym_level(ACYM_ENTERPRISE)) { ?> |
| 323 |
<div class="cell medium-3"> |
| 324 |
<?php |
| 325 |
echo esc_html(acym_translation('ACYM_SET_FOLLOWUP_PRIORITY')); |
| 326 |
acym_info(['textShownInTooltip' => 'ACYM_SET_FOLLOWUP_PRIORITY_DESC']); ?> |
| 327 |
</div> |
| 328 |
<div class="cell medium-9 grid-x"> |
| 329 |
<div class="cell medium-6 large-4 xlarge-3 xxlarge-2"> |
| 330 |
<?php acym_switch(['name' => 'config[followup_max_priority]', 'value' => $this->config->get('followup_max_priority', 0)]); ?> |
| 331 |
</div> |
| 332 |
</div> |
| 333 |
<div class="cell medium-3 automatic_only automatic_manual"> |
| 334 |
<?php |
| 335 |
echo esc_html(acym_translation('ACYM_USE_DEDICATED_SENDING_PROCESS')); |
| 336 |
acym_info(['textShownInTooltip' => 'ACYM_USE_DEDICATED_SENDING_PROCESS_DESC']); ?> |
| 337 |
</div> |
| 338 |
<div class="cell medium-9 grid-x automatic_only automatic_manual"> |
| 339 |
<div class="cell medium-6 large-4 xlarge-3 xxlarge-2"> |
| 340 |
<?php |
| 341 |
acym_switch([ |
| 342 |
'name' => 'config[dedicated_send_process]', |
| 343 |
'value' => $this->config->get('dedicated_send_process', 0), |
| 344 |
]); |
| 345 |
?> |
| 346 |
</div> |
| 347 |
</div> |
| 348 |
<?php } ?> |
| 349 |
</div> |
| 350 |
</div> |
| 351 |
<?php |
| 352 |
if (!acym_level(ACYM_ESSENTIAL)) { |
| 353 |
echo '<div class="acym_area"> |
| 354 |
<div class="acym__title acym__title__secondary">'.esc_html(acym_translation('ACYM_CRON')).'</div>'; |
| 355 |
include acym_getView('configuration', 'upgrade_license'); |
| 356 |
echo '</div>'; |
| 357 |
} |
| 358 |
|