PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.0.2
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.0.2
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Views / Campaigns / tmpl / summary.php

summary.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 11.0.2, at back/Views/Campaigns/tmpl/summary.php

475 lines 26.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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\Classes\CampaignClass;
6
7 $isAbTest = $data['abtest'];
8 $isSent = !empty($data['campaignInformation']->sent) && !empty($data['campaignInformation']->active);
9 $campaignController = acym_isAdmin() ? 'campaigns' : 'frontcampaigns';
10 ?>
11 <form id="acym_form"
12 action="<?php echo esc_url(acym_completeLink(acym_getVar('cmd', 'ctrl'))); ?>"
13 method="post"
14 name="acyForm"
15 class="acym__form__campaign__edit <?php echo !empty($data['menuClass']) ? esc_attr($data['menuClass']) : ''; ?>"
16 data-abide
17 novalidate>
18 <div class="grid-x">
19 <div class="cell medium-auto"></div>
20 <div class="cell <?php echo esc_attr($data['containerClass']); ?> acym__content">
21
22 <?php
23 $this->addSegmentStep($data['displaySegmentTab']);
24 $workflow = $data['workflowHelper'];
25 $workflow->display($this->steps, $this->step, true, false, '', 'campaignId');
26 ?>
27
28 <div id="acym__campaign__summary" class="grid-x grid-margin-y">
29 <div class="cell grid-x acym__campaign__summary__section margin-right-2">
30 <h5 class="cell shrink margin-next-1 acym__title acym__title__secondary">
31 <b><?php echo esc_html(acym_translation('ACYM_EMAIL')); ?></b>
32 </h5>
33 <div class="cell auto acym__campaign__summary__modify">
34 <a href="<?php echo esc_url(
35 acym_completeLink(
36 $campaignController.'&task=edit&step=editEmail&edition=1&campaignId='.intval($data['campaignInformation']->id)
37 )
38 ); ?>"><i class="acymicon-pencil"></i><span> <?php echo esc_html(acym_translation('ACYM_EDIT')); ?></span></a>
39 </div>
40 <div class="cell grid-x">
41 <p class="cell medium-6 acym__campaign__summary__email__information">
42 <?php echo esc_html(acym_translation('ACYM_FROM_NAME')); ?>: <span class="acym__color__blue">
43 <?php echo esc_html($data['mailInformation']->from_name); ?>
44 </span>
45 </p>
46 <p class="cell medium-6 acym__campaign__summary__email__information">
47 <?php echo esc_html(acym_translation('ACYM_FROM_EMAIL')); ?>: <span class="acym__color__blue">
48 <?php echo esc_html($data['mailInformation']->from_email); ?>
49 </span>
50 </p>
51 <p class="cell medium-6 acym__campaign__summary__email__information">
52 <?php echo esc_html(acym_translation('ACYM_REPLYTO_NAME')); ?>: <span class="acym__color__blue">
53 <?php echo esc_html($data['mailInformation']->reply_to_name); ?>
54 </span>
55 </p>
56 <p class="cell medium-6 acym__campaign__summary__email__information">
57 <?php echo esc_html(acym_translation('ACYM_REPLYTO_EMAIL')); ?>: <span class="acym__color__blue">
58 <?php echo esc_html($data['mailInformation']->reply_to_email); ?>
59 </span>
60 </p>
61 <p class="cell medium-6 margin-bottom-1 margin-top-1 acym__campaign__summary__email__information">
62 <?php echo esc_html(acym_translation('ACYM_EMAIL_SUBJECT')); ?>:
63 <span class="acym__color__blue acym__campaign__summary__email__information-subject">
64 <?php echo esc_html($data['mailInformation']->subject); ?>
65 </span>
66 </p>
67 <?php if (!empty($data['isArchiveCached'])) { ?>
68 <div class="cell grid-x grid-margin-x" id="acym__campaigns__summary__archive__refresh">
69 <button
70 id="acym__campaigns__summary__refresh__archive"
71 class="button-secondary button margin-top-0 margin-bottom-2 margin-right-0 cell medium-shrink">
72 <?php echo esc_html(acym_translation('ACYM_REFRESH_ARCHIVE')); ?>
73 </button>
74 <?php acym_info(['textShownInTooltip' => 'ACYM_REFRESH_ARCHIVE_DESC']); ?>
75 <div id="acym__campaigns__summary__refresh__archive__message"></div>
76 </div>
77 <?php } ?>
78 </div>
79 <!-- We add the email content in a hidden div to load it into the iframe preview -->
80 <?php
81 if ($data['multilingual']) {
82 include acym_getView('campaigns', 'summary_languages', true);
83 }
84 if (!empty($data['abtest'])) {
85 include acym_getView('campaigns', 'summary_abtest', true);
86 }
87 ?>
88 <input type="hidden" class="acym__hidden__mail__content" value="<?php echo esc_attr(acym_absoluteURL($data['mailInformation']->body)); ?>">
89 <input type="hidden" class="acym__hidden__mail__stylesheet" value="<?php echo esc_attr($data['mailInformation']->stylesheet); ?>">
90 <div class="cell grid-x">
91 <div id="acym__wysid__email__preview" class="acym__email__preview grid-x cell"></div>
92 </div>
93 </div>
94 <?php if (!empty($data['mailInformation']->attachments)) { ?>
95 <div class="cell grid-x acym__campaign__summary__section">
96 <h5 class="cell shrink margin-next-1 acym__title acym__title__secondary">
97 <b><?php echo esc_html(acym_translation('ACYM_ATTACHMENTS')); ?></b>
98 </h5>
99 <div class="cell auto acym__campaign__summary__modify">
100 <a href="<?php echo esc_url(
101 acym_completeLink(
102 $campaignController.'&task=edit&step=editEmail&edition=1&campaignId='.intval($data['campaignInformation']->id)
103 )
104 ); ?>"><i
105 class="acymicon-pencil"></i><span> <?php echo esc_html(acym_translation('ACYM_EDIT')); ?></span></a>
106 </div>
107 <?php
108 $attachments = json_decode($data['mailInformation']->attachments, true);
109 foreach ($attachments as $key => $oneAttachment) {
110 $onlyFilename = explode('/', $oneAttachment['filename']);
111
112 $onlyFilename = end($onlyFilename);
113
114 acym_tooltip(
115 [
116 'hoveredText' => '<div class="cell" data-toggle="path_attachment_'.$key.'">'.$onlyFilename.'</div>',
117 'textShownInTooltip' => $oneAttachment['filename'],
118 'classContainer' => 'cell',
119 ]
120 );
121 }
122 ?>
123 </div>
124 <?php } ?>
125 <div class="cell grid-x acym__campaign__summary__section">
126 <h5 class="cell shrink margin-next-1 acym__title acym__title__secondary">
127 <b>
128 <?php
129 echo esc_html(acym_translation('ACYM_RECIPIENTS'));
130 echo ' ('.esc_html($data['nbSubscribers'].' '.acym_translation('ACYM_SUBSCRIBERS'));
131 acym_info(['textShownInTooltip' => 'ACYM_SUMMARY_NUMBER_RECEIVERS_DESC']);
132 echo ')';
133 ?>
134 </b>
135 </h5>
136 <div class="cell auto acym__campaign__summary__modify">
137 <a href="<?php echo esc_url(
138 acym_completeLink(
139 $campaignController.'&task=edit&step=recipients&edition=1&campaignId='.intval($data['campaignInformation']->id)
140 )
141 ); ?>"><i class="acymicon-pencil"></i><span> <?php echo esc_html(acym_translation('ACYM_EDIT')); ?></span></a>
142 </div>
143 <div class="cell acym__listing">
144 <?php foreach ($data['listsReceiver'] as $oneList) { ?>
145 <div class="cell grid-x acym__listing__row">
146 <span class="cell small-6">
147 <i class="acymicon-circle acym__campaign__summary__recipients__list__color margin-right-1"
148 style="color: <?php echo esc_attr($oneList->color); ?>">
149 </i>
150 <b><?php echo esc_html($oneList->name); ?></b>
151 </span>
152 <span class="cell small-6">
153 <?php
154 acym_modalInclude(
155 '<span class="text-underline cursor-pointer">
156 <b>'.esc_html($oneList->subscribers).'
157 </b> '.esc_html(acym_strtolower(acym_translation('ACYM_SUBSCRIBERS'))).'
158 </span>',
159 acym_getPartial('modal', 'users'),
160 'acym__campaign__summary__users_summary__'.$oneList->list_id,
161 [
162 'ctrl' => acym_isAdmin() ? 'lists' : 'frontlists',
163 'task' => 'usersSummary',
164 'list_id' => $oneList->list_id,
165 ],
166 'acym__modal__users__summary__container'
167 );
168 ?>
169 </span>
170 </div>
171 <?php } ?>
172 </div>
173 <?php if (!empty($data['segment'])) { ?>
174 <div class="cell grid-x acym__campaign__summary__section margin-top-1">
175 <h5 class="cell shrink margin-next-1 acym__title acym__title__secondary"><?php
176 if (!empty($data['campaignInformation']->sending_params['segment']['invert'])) {
177 $segmentInformation = $data['campaignInformation']->sending_params['segment']['invert'] === 'exclude'
178 ? ' ('.acym_translation('ACYM_EXCLUDE').')'
179 : ' ('.acym_translation('ACYM_INCLUDE').')';
180 } else {
181 $segmentInformation = ' ('.acym_translation('ACYM_INCLUDE').')';
182 }
183 echo esc_html(acym_translation('ACYM_SEGMENT').$segmentInformation);
184 ?></h5>
185 <div class="cell auto acym__campaign__summary__modify">
186 <a href="<?php echo esc_url(
187 acym_completeLink(
188 $campaignController.'&task=edit&step=segment&edition=1&campaignId='.intval($data['campaignInformation']->id)
189 )
190 ); ?>"><i class="acymicon-pencil"></i><span> <?php echo esc_html(acym_translation('ACYM_EDIT')); ?></span></a>
191 </div>
192 <div class="cell grid-x acym__campaign__summary__segment">
193 <span class="cell medium-6"><b><?php echo esc_html($data['segment']['name']); ?></b></span>
194 <span class="cell medium-6"><b>
195 <?php echo esc_html($data['segment']['count']).'</b> '.esc_html(strtolower(acym_translation('ACYM_SUBSCRIBERS'))); ?>
196 </span>
197 </div>
198 </div>
199 <?php } ?>
200 </div>
201 <?php if (!empty($data['campaignInformation']->sending_params['abtest'])) {
202 $numberOfUsersToSend = round($data['campaignInformation']->sending_params['abtest']['repartition'] * $data['nbSubscribersAbTest'] / 100);
203 ?>
204 <div class="cell grid-x acym__campaign__summary__section">
205 <h5 class="cell shrink margin-next-1 acym__title acym__title__secondary">
206 <b><?php echo esc_html(acym_translation('ACYM_AB_TEST')); ?></b>
207 </h5>
208 <div class="cell auto acym__campaign__summary__modify">
209 <a href="<?php echo esc_url(
210 acym_completeLink(
211 $campaignController.'&task=edit&step=sendSettings&edition=1&campaignId='.intval($data['campaignInformation']->id)
212 )
213 ); ?>"><i class="acymicon-pencil"></i><span> <?php echo esc_html(acym_translation('ACYM_EDIT')); ?></span></a>
214 </div>
215 <div class="cell acym__listing">
216 <div class="cell acym__listing__row">
217 <?php echo esc_html(
218 acym_translationSprintf(
219 'ACYM_VERSION_WILL_BE_SENT_TO_X_SUBSCRIBERS',
220 acym_translationSprintf('ACYM_VERSION_NAME', 'A'),
221 round($numberOfUsersToSend / 2)
222 )
223 ); ?>
224 </div>
225 <div class="cell acym__listing__row">
226 <?php echo esc_html(
227 acym_translationSprintf(
228 'ACYM_VERSION_WILL_BE_SENT_TO_X_SUBSCRIBERS',
229 acym_translationSprintf('ACYM_VERSION_NAME', 'B'),
230 $numberOfUsersToSend - round($numberOfUsersToSend / 2)
231 )
232 ); ?>
233 </div>
234 </div>
235 <?php if (!empty($data['segment'])) { ?>
236 <div class="cell grid-x acym__campaign__summary__section margin-top-1">
237 <h5 class="cell shrink margin-next-1 acym__title acym__title__secondary"><?php
238 if (!empty($data['campaignInformation']->sending_params['segment']['invert'])) {
239 $segmentInformation = $data['campaignInformation']->sending_params['segment']['invert'] === 'exclude'
240 ? ' ('.acym_translation('ACYM_EXCLUDE').')'
241 : ' ('.acym_translation('ACYM_INCLUDE').')';
242 } else {
243 $segmentInformation = ' ('.acym_translation('ACYM_INCLUDE').')';
244 }
245 echo esc_html(acym_translation('ACYM_SEGMENT').$segmentInformation);
246 ?></h5>
247 <div class="cell auto acym__campaign__summary__modify">
248 <a href="<?php echo esc_url(
249 acym_completeLink(
250 $campaignController.'&task=edit&step=segment&edition=1&campaignId='.intval($data['campaignInformation']->id)
251 )
252 ); ?>"><i class="acymicon-pencil"></i><span> <?php echo esc_html(acym_translation('ACYM_EDIT')); ?></span></a>
253 </div>
254 <div class="cell grid-x acym__campaign__summary__segment">
255 <span class="cell medium-6"><b><?php echo esc_html($data['segment']['name']); ?></b></span>
256 <span class="cell medium-6"><b><?php echo esc_html($data['segment']['count']).'</b> '.esc_html(
257 strtolower(acym_translation('ACYM_SUBSCRIBERS'))
258 ); ?></span>
259 </div>
260 </div>
261 <?php } ?>
262 </div>
263 <?php } ?>
264 <div class="cell grid-x acym__campaign__summary__section">
265 <h5 class="cell shrink margin-next-1 acym__title acym__title__secondary">
266 <b><?php echo esc_html(acym_translation('ACYM_SEND_SETTINGS')); ?></b>
267 </h5>
268 <div class="cell auto acym__campaign__summary__modify">
269 <a href="<?php echo esc_url(
270 acym_completeLink(
271 $campaignController.'&task=edit&step=sendSettings&edition=1&campaignId='.intval($data['campaignInformation']->id)
272 )
273 ); ?>"><i class="acymicon-pencil"></i><span> <?php echo esc_html(acym_translation('ACYM_EDIT')); ?></span></a>
274 </div>
275 <div class="cell grid-x grid-margin-x">
276 <p class="cell large-2 medium-3"><b><?php echo esc_html(acym_translation('ACYM_SENDING_TYPE')); ?>:</b></p>
277 <p class="cell auto">
278 <?php
279 if ($data['automatic']['isAuto']) {
280 echo esc_html($data['automatic']['text']);
281 } elseif ($data['campaignClass']::SENDING_TYPE_SCHEDULED === $data['campaignInformation']->sending_type) {
282 if (empty($data['campaignInformation']->sending_date)) {
283 echo esc_html(acym_translation('ACYM_PLEASE_SET_SEND_DATE'));
284 } else {
285 if ($isSent) {
286 $text = 'ACYM_THIS_CAMPAIGN_HAS_BEEN_SENT_ON_AT';
287 } else {
288 $text = 'ACYM_THIS_CAMPAIGN_WILL_BE_SENT_ON_AT';
289 }
290
291 echo esc_html(
292 acym_translationSprintf(
293 $text,
294 acym_date($data['campaignInformation']->sending_date, 'F j, Y'),
295 acym_date($data['campaignInformation']->sending_date, 'H:i')
296 )
297 );
298 }
299 } elseif (!$isSent) {
300 echo esc_html(acym_translation('ACYM_THIS_CAMPAIGN_WILL_BE_SENT').' '.acym_strtolower(acym_translation('ACYM_NOW')));
301 } else {
302 echo esc_html(
303 acym_translationSprintf(
304 'ACYM_THIS_CAMPAIGN_HAS_BEEN_SENT_ON_AT',
305 acym_date($data['campaignInformation']->sending_date, 'F j, Y'),
306 acym_date($data['campaignInformation']->sending_date, 'H:i')
307 )
308 );
309 }
310 ?>
311 </p>
312 </div>
313 <?php if ($data['automatic']['isAuto'] && !empty($data['automatic']['nextDate'])) { ?>
314 <div class="cell grid-x grid-margin-x">
315 <p class="cell large-2 medium-3"><b><?php echo esc_html(acym_translation('ACYM_NEXT_GENERATION_DATE')); ?>:</b></p>
316 <p class="cell auto"><?php echo esc_html(acym_date($data['automatic']['nextDate'], acym_getDateTimeFormat())); ?></p>
317 </div>
318 <?php } ?>
319 <div class="cell grid-x grid-margin-x">
320 <p class="cell large-2 medium-3"><b><?php echo esc_html(acym_translation('ACYM_TRACKING')); ?>:</b></p>
321 <p class="cell auto">
322 <?php echo esc_html(
323 acym_translation($data['campaignInformation']->tracking ? 'ACYM_THIS_CAMPAIGN_BEING_TRACKED' : 'ACYM_THIS_CAMPAIGN_NOT_BEING_TRACKED')
324 ); ?>
325 </p>
326 </div>
327 </div>
328 <div class="cell grid-x acym__campaign__summary__bottom-controls acym__campaign__summary__section">
329 <?php
330 if (!$isAbTest && !empty($data['campaignInformation']->sent) && !empty($data['campaignInformation']->active)) {
331 ?>
332 <div id="acym__campaign__summary__resendoptions" class="cell padding-1 margin-bottom-1 acym__zone__warning">
333 <?php
334 echo esc_html(acym_translationSprintf('ACYM_ALREADY_SENT'));
335 acym_radio(
336 [
337 'new' => acym_translation('ACYM_YES'),
338 'all' => acym_translation('ACYM_ALREADY_SENT_ALL'),
339 ],
340 'resend_target',
341 null,
342 [],
343 ['required' => true],
344 !acym_isAdmin()
345 );
346 ?>
347 <div class="cell">
348 <span id="resend_receivers_new" style="display: none;">
349 <?php echo esc_html(acym_translationSprintf('ACYM_X_RECIPIENTS', $data['receiversNew'])); ?>
350 </span>
351 <span id="resend_receivers_all" style="display: none;">
352 <?php echo esc_html(acym_translationSprintf('ACYM_X_RECIPIENTS', $data['nbSubscribers'])); ?>
353 </span>
354 </div>
355 </div>
356 <?php
357 }
358 ?>
359 <div class="cell medium-shrink medium-margin-bottom-0 margin-bottom-1 text-left">
360 <?php
361 acym_backToListing(
362 in_array($data['campaignInformation']->sending_type, ['birthday', 'woocommerce_cart'])
363 ? $campaignController.'&task=specificListing&type='.$data['campaignInformation']->sending_type : $campaignController
364 );
365 ?>
366 </div>
367 <div class="cell medium-auto grid-x text-right">
368 <div class="cell auto hide-for-small-only"></div>
369
370 <?php
371 // The campaign is in the queue and has been paused
372 if (empty($data['campaignInformation']->active) && !$data['campaignInformation']->isAuto && $data['campaignInformation']->sent) {
373 ?>
374
375 <button type="button" class="cell button primary acy_button_submit medium-shrink" data-task="unpause_campaign">
376 <?php echo esc_html(acym_translation('ACYM_UNPAUSE_CAMPAIGN')); ?>
377 </button>
378
379 <?php
380 } elseif ($data['campaignInformation']->active && $data['campaignInformation']->isAuto) {
381 ?>
382
383 <button type="button" class="cell button primary acy_button_submit medium-shrink" data-task="toggleActivateColumnCampaign">
384 <?php echo esc_html(acym_translation('ACYM_DEACTIVATE_CAMPAIGN')); ?>
385 </button>
386 <?php
387 } else {
388 // The campaign isn't already sent
389 if (empty($data['campaignInformation']->sent) && (empty($data['campaignInformation']->active) && $data['campaignInformation']->draft)) {
390 ?>
391
392 <button type="submit"
393 class="cell button button-secondary margin-bottom-1 margin-next-1 acy_button_submit medium-shrink"
394 data-task="saveAsDraftCampaign">
395 <?php echo esc_html(acym_translation('ACYM_SAVE_AS_DRAFT')); ?>
396 </button>
397
398 <?php
399 }
400
401 if (CampaignClass::SENDING_TYPE_NOW == $data['campaignInformation']->sending_type) {
402 $task = 'addQueue';
403 $buttonText = 'ACYM_SEND_CAMPAIGN';
404 if (!acym_level(ACYM_ESSENTIAL) || $this->config->get('cron_last', 0) < (time() - 43200)) $buttonText = 'ACYM_ADD_TO_QUEUE';
405 } elseif (!$data['campaignInformation']->isAuto) {
406 $task = 'confirmCampaign';
407 $buttonText = 'ACYM_CONFIRM_CAMPAIGN';
408 } else {
409 $task = 'activeAutoCampaign';
410 $buttonText = 'ACYM_ACTIVE_CAMPAIGN';
411 }
412
413
414 if ($isAbTest && empty($data['campaignInformation']->sending_params['abtest']['B'])) {
415 $data['notAllowedSendingError'] = acym_translation('ACYM_VERSION_MISSING_AB_TEST');
416 }
417
418 if (isset($numberOfUsersToSend) && $numberOfUsersToSend < 2) {
419 $data['notAllowedSendingError'] = acym_translation('ACYM_NOT_ENOUGH_USERS_AB_TEST');
420 }
421
422 if ($isAbTest && $isSent) {
423 $data['notAllowedSendingError'] = acym_translation('ACYM_CANNOT_SEND_AB_TEST_AGAIN');
424 }
425
426 if ($data['nbSubscribers'] <= 0) {
427 $data['notAllowedSendingError'] = acym_translation('ACYM_ADD_RECIPIENTS_TO_SEND_THIS_CAMPAIGN');
428 }
429
430 $buttonClass = empty($data['notAllowedSendingError']) ? '' : ' disabled';
431
432 if (!empty($data['notAllowedSendingError'])) {
433 ob_start();
434 }
435
436 if ($this->config->get('mailer_method') === 'acymailer' && $this->config->get('acymailer_popup', '0') === '0') {
437 ob_start();
438 require acym_getView('mails', 'acymailer_popup', true);
439 $popupData = ob_get_clean();
440 acym_modal(
441 acym_translation($buttonText),
442 $popupData,
443 'acym__acymailer__popup',
444 [],
445 ['class' => 'cell button medium-shrink'.$buttonClass]
446 );
447 } else {
448 echo '<button type="button" class="cell button acy_button_submit medium-shrink'.esc_attr($buttonClass).'" data-task="'.esc_attr($task).'">';
449 echo esc_html(acym_translation($buttonText));
450 echo '</button>';
451 }
452
453 if (!empty($data['notAllowedSendingError'])) {
454 $button = ob_get_clean();
455 acym_tooltip(
456 [
457 'hoveredText' => $button,
458 'textShownInTooltip' => $data['notAllowedSendingError'],
459 'classContainer' => 'cell medium-shrink',
460 ]
461 );
462 }
463 }
464 ?>
465 </div>
466 </div>
467 </div>
468 </div>
469 <div class="cell medium-auto"></div>
470 </div>
471 <input type="hidden" value="<?php echo intval($data['campaignInformation']->id); ?>" name="campaignId" />
472 <input type="hidden" value="<?php echo esc_attr((string)$data['campaignInformation']->sending_date); ?>" name="sending_date" />
473 <?php acym_formOptions(true, 'edit', 'summary'); ?>
474 </form>
475