| 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 |
$newsletters = [ |
| 6 |
[ |
| 7 |
'data-link' => $data['campaign_link'], |
| 8 |
'type' => 'campaign', |
| 9 |
'icon' => 'bullhorn', |
| 10 |
'title' => 'ACYM_CLASSIC_CAMPAIGN', |
| 11 |
'desc' => 'ACYM_CLASSIC_CAMPAIGN_DESC', |
| 12 |
'level' => ACYM_STARTER, |
| 13 |
], |
| 14 |
[ |
| 15 |
'data-link' => $data['campaign_scheduled_link'], |
| 16 |
'type' => 'scheduled', |
| 17 |
'icon' => 'access-time', |
| 18 |
'title' => 'ACYM_SCHEDULED_CAMPAIGN', |
| 19 |
'promotion-text' => 'ACYM_PROMOTE_SCHEDULED_CAMPAIGN', |
| 20 |
'desc' => 'ACYM_SCHEDULED_CAMPAIGN_DESC', |
| 21 |
'level' => ACYM_ESSENTIAL, |
| 22 |
'error_message' => 'ACYM_ONLY_AVAILABLE_ESSENTIAL_VERSION', |
| 23 |
], |
| 24 |
[ |
| 25 |
'data-link' => $data['campaign_test_link'], |
| 26 |
'type' => 'campaign_test', |
| 27 |
'icon' => 'flask', |
| 28 |
'title' => 'ACYM_AB_TEST_CAMPAIGN', |
| 29 |
'desc' => 'ACYM_AB_TEST_CAMPAIGN_DESC', |
| 30 |
'level' => ACYM_ENTERPRISE, |
| 31 |
'error_message' => 'ACYM_ONLY_AVAILABLE_ENTERPRISE_VERSION', |
| 32 |
], |
| 33 |
[ |
| 34 |
'data-link' => $data['campaign_auto_link'], |
| 35 |
'type' => 'automatic_campaign', |
| 36 |
'icon' => 'autorenew', |
| 37 |
'title' => 'ACYM_AUTOMATIC_CAMPAIGN', |
| 38 |
'promotion-text' => 'ACYM_PROMOTE_AUTO_CAMPAIGN', |
| 39 |
'desc' => 'ACYM_AUTOMATIC_CAMPAIGN_DESC', |
| 40 |
'level' => ACYM_ENTERPRISE, |
| 41 |
'error_message' => 'ACYM_ONLY_AVAILABLE_ENTERPRISE_VERSION', |
| 42 |
], |
| 43 |
[ |
| 44 |
'data-link' => $data['followup_link'], |
| 45 |
'type' => 'followup', |
| 46 |
'icon' => 'email', |
| 47 |
'title' => 'ACYM_FOLLOW_UP', |
| 48 |
'promotion-text' => 'ACYM_PROMOTE_FOLLOWUP_CAMPAIGN', |
| 49 |
'desc' => 'ACYM_FOLLOW_UP_DESC', |
| 50 |
'level' => ACYM_ENTERPRISE, |
| 51 |
'error_message' => 'ACYM_ONLY_AVAILABLE_ENTERPRISE_VERSION', |
| 52 |
], |
| 53 |
]; |
| 54 |
|
| 55 |
$classesOneTimeEmails = 'acym__campaign__selection__card acym__selection__select-card cell xxlarge-2 large-3 medium-4 text-center'; |
| 56 |
?> |
| 57 |
<form id="acym_form" action="<?php echo esc_url(acym_completeLink(acym_getVar('cmd', 'ctrl'))); ?>" method="post" name="acyForm"> |
| 58 |
<div id="acym__email__new" class="cell grid-x grid-margin-y align-center acym__content margin-top-2 acym__selection"> |
| 59 |
<div class="cell shrink medium-12"> |
| 60 |
<h1 class="margin-top-1 margin-bottom-2 acym__title acym__campaign__selection__title text-center"> |
| 61 |
<?php echo esc_html(acym_translation('ACYM_WHICH_KIND_OF_MAIL_CREATE')); ?> |
| 62 |
</h1> |
| 63 |
</div> |
| 64 |
<div class="cell shrink medium-4 margin-bottom-3"> |
| 65 |
<ul class="acym__selection__page__tabs" id="workflow"> |
| 66 |
<?php if ($data['isNewslettersTab']) { ?> |
| 67 |
<li class="step current_step" data-tab="acym__campaign__selection__newsletters"> |
| 68 |
<a> |
| 69 |
<?php echo esc_html(acym_translation('ACYM_NEWSLETTERS')); ?> |
| 70 |
</a> |
| 71 |
</li> |
| 72 |
<li class="step " data-tab="acym__campaign__selection__onetime"> |
| 73 |
<a> |
| 74 |
<?php echo esc_html(acym_translation('ACYM_ONE_TIME_EMAIL')); ?> |
| 75 |
</a> |
| 76 |
</li> |
| 77 |
<?php } else { ?> |
| 78 |
<li class="step" data-tab="acym__campaign__selection__newsletters"> |
| 79 |
<a> |
| 80 |
<?php echo esc_html(acym_translation('ACYM_NEWSLETTERS')); ?> |
| 81 |
</a> |
| 82 |
</li> |
| 83 |
<li class="step current_step" data-tab="acym__campaign__selection__onetime"> |
| 84 |
<a> |
| 85 |
<?php echo esc_html(acym_translation('ACYM_ONE_TIME_EMAIL')); ?> |
| 86 |
</a> |
| 87 |
</li> |
| 88 |
<?php } ?> |
| 89 |
</ul> |
| 90 |
</div> |
| 91 |
<!-- Newsletters --> |
| 92 |
<div id="acym__campaign__selection__newsletters" |
| 93 |
class="cell grid-x grid-margin-x align-center margin-y" |
| 94 |
style="<?php echo $data['isNewslettersTab'] ? '' : 'display: none;'; ?>"> |
| 95 |
<?php |
| 96 |
foreach ($newsletters as $oneNewsletterType) { |
| 97 |
$classes = ''; |
| 98 |
if (!acym_level($oneNewsletterType['level'])) { |
| 99 |
$classes = 'acym__selection__card__promotion '; |
| 100 |
} |
| 101 |
$classes .= 'acym__campaign__selection__card cell xxlarge-2 large-3 medium-4 text-center'; |
| 102 |
if ($oneNewsletterType['type'] === $data['selectedType']) { |
| 103 |
$classes .= ' acym__campaign__selection__card-selected '; |
| 104 |
} else { |
| 105 |
$classes .= ''; |
| 106 |
} |
| 107 |
if ($oneNewsletterType['type'] === 'scheduled') { |
| 108 |
$classes .= ' scheduled '; |
| 109 |
} ?> |
| 110 |
<div class="<?php echo esc_attr($classes); ?> acym__campaign__selection__card-container" |
| 111 |
data-email-type="<?php echo esc_attr($oneNewsletterType['type']); ?>"> |
| 112 |
<?php if (!acym_level($oneNewsletterType['level'])) { ?> |
| 113 |
<div class="acym__selection__card__lock"> |
| 114 |
<i class="acymicon-lock"></i> |
| 115 |
</div> |
| 116 |
<?php } ?> |
| 117 |
<i class="acymicon-<?php echo esc_attr($oneNewsletterType['icon']); ?> acym__selection__card__icon"></i> |
| 118 |
<h1 class="acym__selection__card__title"><?php echo esc_html(acym_translation($oneNewsletterType['title'])); ?></h1> |
| 119 |
<?php if (!acym_level($oneNewsletterType['level'])) { ?> |
| 120 |
<p class="acym__selection__card__promotion__text"><?php if (!empty($oneNewsletterType['promotion-text'])) { |
| 121 |
echo esc_html( |
| 122 |
acym_translation( |
| 123 |
$oneNewsletterType['promotion-text'] |
| 124 |
) |
| 125 |
); |
| 126 |
} ?></p> |
| 127 |
<?php } else { ?> |
| 128 |
<p class="acym__selection__card__promotion__text"><?php echo ' '; ?></p> |
| 129 |
<?php } ?> |
| 130 |
<p class="acym__selection__card__description"><?php echo esc_html(acym_translation($oneNewsletterType['desc'])); ?></p> |
| 131 |
<button type="button" |
| 132 |
class="cell shrink button acym__campaign__selection__button-select button-primary <?php echo acym_level($oneNewsletterType['level']) ? '' |
| 133 |
: 'acym__promotion__disabled__button'; ?>" |
| 134 |
acym-data-link="<?php echo acym_level($oneNewsletterType['level']) ? esc_url($oneNewsletterType['data-link']) : ''; ?>"> |
| 135 |
<?php echo esc_html(acym_translation('ACYM_CREATE')); ?> |
| 136 |
</button> |
| 137 |
</div> |
| 138 |
<?php |
| 139 |
} |
| 140 |
?> |
| 141 |
</div> |
| 142 |
<!-- One time email --> |
| 143 |
<?php if (acym_isAllowed('mails')) { ?> |
| 144 |
<div id="acym__campaign__selection__onetime" |
| 145 |
class="cell grid-x grid-margin-x align-center margin-y" |
| 146 |
style="<?php echo $data['isNewslettersTab'] ? 'display: none;' : ''; ?>"> |
| 147 |
<?php |
| 148 |
$classes = $classesOneTimeEmails; |
| 149 |
if ($data['selectedType'] === 'welcome') { |
| 150 |
$classes .= ' acym__campaign__selection__card-selected '; |
| 151 |
} else { |
| 152 |
$classes .= ' '; |
| 153 |
} |
| 154 |
?> |
| 155 |
<div class="<?php echo esc_attr($classes); ?> acym__campaign__selection__card-container"> |
| 156 |
<i class="acymicon-handshake-o acym__selection__card__icon"></i> |
| 157 |
<h1 class="acym__selection__card__title"><?php echo esc_html(acym_translation('ACYM_WELCOME_EMAIL')); ?></h1> |
| 158 |
<p class="acym__selection__card__description"><?php echo esc_html(acym_translation('ACYM_WELCOME_EMAIL_DESC')); ?></p> |
| 159 |
<?php acym_select( |
| 160 |
$data['lists'], |
| 161 |
'welcome_list_id', |
| 162 |
null, |
| 163 |
['class' => 'acym__email__new__card__select acym__select'], |
| 164 |
'value', |
| 165 |
'text', |
| 166 |
null, |
| 167 |
false, |
| 168 |
true |
| 169 |
); ?> |
| 170 |
<button type="button" |
| 171 |
class="cell shrink button acym__campaign__selection__button-select button-primary" |
| 172 |
acym-data-link="<?php echo esc_url($data['welcome_email_link']); ?>"> |
| 173 |
<?php echo esc_html(acym_translation('ACYM_CREATE')); ?> |
| 174 |
</button> |
| 175 |
</div> |
| 176 |
<?php |
| 177 |
$classes = $classesOneTimeEmails; |
| 178 |
if ($data['selectedType'] === 'unsubscribe') { |
| 179 |
$classes .= ' acym__campaign__selection__card-selected '; |
| 180 |
} else { |
| 181 |
$classes .= ' '; |
| 182 |
} |
| 183 |
?> |
| 184 |
<div class="<?php echo esc_attr($classes); ?> acym__campaign__selection__card-container"> |
| 185 |
<i class="acymicon-hand-paper-o acym__selection__card__icon"></i> |
| 186 |
<h1 class="acym__selection__card__title"><?php echo esc_html(acym_translation('ACYM_UNSUBSCRIBE_EMAIL')); ?></h1> |
| 187 |
<p class="acym__selection__card__description"><?php echo esc_html(acym_translation('ACYM_UNSUBSCRIBE_EMAIL_DESC')); ?></p> |
| 188 |
<?php acym_select( |
| 189 |
$data['lists'], |
| 190 |
'unsubscribe_list_id', |
| 191 |
null, |
| 192 |
['class' => 'acym__email__new__card__select acym__select'], |
| 193 |
'value', |
| 194 |
'text', |
| 195 |
null, |
| 196 |
false, |
| 197 |
true |
| 198 |
); ?> |
| 199 |
<button type="button" |
| 200 |
class="cell shrink button acym__campaign__selection__button-select button-primary" |
| 201 |
acym-data-link="<?php echo esc_url($data['unsubscribe_email_link']); ?>"> |
| 202 |
<?php echo esc_html(acym_translation('ACYM_CREATE')); ?> |
| 203 |
</button> |
| 204 |
</div> |
| 205 |
<?php |
| 206 |
foreach ($data['extraBlocks'] as $oneExtra) { |
| 207 |
if (!acym_level($oneExtra['level'])) { |
| 208 |
continue; |
| 209 |
} |
| 210 |
|
| 211 |
$classes = $classesOneTimeEmails; |
| 212 |
if (!empty($oneExtra['email_type']) && $data['selectedType'] === $oneExtra['email_type']) { |
| 213 |
$classes .= ' acym__campaign__selection__card-selected '; |
| 214 |
} else { |
| 215 |
$classes .= ' '; |
| 216 |
} |
| 217 |
?> |
| 218 |
<div class="<?php echo esc_attr($classes); ?> acym__campaign__selection__card-container"> |
| 219 |
<i class="<?php echo esc_attr($oneExtra['icon']); ?> acym__selection__card__icon"></i> |
| 220 |
<h1 class="acym__selection__card__title"><?php echo esc_html($oneExtra['name']); ?></h1> |
| 221 |
<p class="acym__selection__card__description"><?php echo esc_html($oneExtra['description']); ?></p> |
| 222 |
<button type="button" |
| 223 |
class="cell shrink button acym__campaign__selection__button-select button-primary" |
| 224 |
acym-data-link="<?php echo esc_url($oneExtra['link']); ?>"> |
| 225 |
<?php echo esc_html(acym_translation('ACYM_CREATE')); ?> |
| 226 |
</button> |
| 227 |
</div> |
| 228 |
<?php } ?> |
| 229 |
</div> |
| 230 |
<?php } ?> |
| 231 |
<?php |
| 232 |
if (!acym_level(ACYM_ENTERPRISE)) { |
| 233 |
$pricingPage = ACYM_ACYMAILING_WEBSITE.'pricing?utm_source=acymailing_plugin&utm_medium=new_email&utm_campaign=upgrade_from_plugin'; |
| 234 |
include acym_getPartial('modal', 'promotion_popup'); |
| 235 |
} |
| 236 |
acym_formOptions(); |
| 237 |
?> |
| 238 |
</div> |
| 239 |
</form> |
| 240 |
|