PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.2.10
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.2.10
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / includes / Types / EmailSubscription.php

EmailSubscription.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.2.10, at includes/Types/EmailSubscription.php

156 lines 5.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Extension Abstract
4 *
5 * @package NotificationX\Extensions
6 */
7
8 namespace NotificationX\Types;
9
10 use NotificationX\Extensions\GlobalFields;
11 use NotificationX\GetInstance;
12 use NotificationX\Modules;
13
14 /**
15 * Extension Abstract for all Extension.
16 * @method static EmailSubscription get_instance($args = null)
17 */
18 class EmailSubscription extends Types {
19 /**
20 * Instance of Admin
21 *
22 * @var Admin
23 */
24 use GetInstance;
25
26 public $priority = 65;
27 public $is_pro = true;
28 public $module = [
29 'modules_mailchimp',
30 'modules_convertkit',
31 'modules_mailchimp',
32 'modules_zapier',
33 ];
34 public $default_source = 'mailchimp';
35
36 /**
37 * Initially Invoked when initialized.
38 */
39 public function __construct(){
40 parent::__construct();
41 $this->id = 'email_subscription';
42 }
43
44 /**
45 * Runs when modules is enabled.
46 *
47 * @return void
48 */
49 public function init(){
50 parent::init();
51 $this->title = __('Email Subscription', 'notificationx');
52 $this->popup = [
53 "denyButtonText" => __("<a href='https://notificationx.com/docs/mailchimp-email-subscription-alert/' target='_blank'>More Info</a>", "notificationx"),
54 "confirmButtonText" => __("<a href='https://notificationx.com/#pricing' target='_blank'>Upgrade to PRO</a>", "notificationx"),
55 "html"=> __('
56 <span>Show popups to display which users subscribed to your Newsletter.</span>
57 <video id="pro_alert_video_popup" type="text/html" allowfullscreen width="450" height="235" autoplay loop muted>
58 <source src="https://notificationx.com/wp-content/uploads/2024/01/How-to-Display-Email-Subscription-Alerts-using-NotificationX.mp4" type="video/mp4">
59 </video>
60 ', 'notificationx')
61 ];
62
63 $common_fields = [
64 'first_param' => 'tag_first_name',
65 'custom_first_param' => __('Someone' , 'notificationx'),
66 'second_param' => __('just subscribed to', 'notificationx'),
67 'third_param' => 'tag_title',
68 'custom_third_param' => __('Anonymous Title', 'notificationx'),
69 'fourth_param' => 'tag_time',
70 'custom_fourth_param' => __( 'Some time ago', 'notificationx' ),
71 ];
72
73 $this->themes = [
74 'theme-one' => [
75 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/subscriptions/mailchimp-theme-1.jpg',
76 'image_shape' => 'rounded',
77 'template' => $common_fields,
78 ],
79 'theme-two' => [
80 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/subscriptions/mailchimp-theme-2.png',
81 'template' => $common_fields,
82 'image_shape' => 'circle',
83 ],
84 'theme-three' => [
85 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/subscriptions/mailchimp-theme-three.jpg',
86 'image_shape' => 'square',
87 'template' => $common_fields,
88 ],
89 'maps_theme' => [
90 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/subscriptions/maps-theme-subscribed.png',
91 'image_shape' => 'square',
92 'show_notification_image' => 'maps_image',
93 ],
94 ];
95
96 $this->res_themes = [
97 'res-theme-one' => [
98 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/res_subscriptions/mailchimp-res-theme-1.png',
99 '_template' => 'mailchimp_template_new',
100 'is_pro' => true,
101 ],
102 'res-theme-two' => [
103 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/res_subscriptions/mailchimp-res-theme-2.png',
104 '_template' => 'mailchimp_template_new',
105 'is_pro' => true,
106 ],
107 'res-theme-three' => [
108 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/res_subscriptions/mailchimp-res-theme-3.png',
109 '_template' => 'mailchimp_template_new',
110 'is_pro' => true,
111 ],
112 'subscriptions-res-theme-four' => [
113 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/res_subscriptions/mailchimp-res-theme-4.png',
114 '_template' => 'maps_template_new',
115 'is_pro' => true,
116 ],
117 ];
118
119 $this->templates = [
120 'mailchimp_template_new' => [
121 'first_param' => GlobalFields::get_instance()->common_name_fields(),
122 'third_param' => [
123 'tag_title' => __('List Title', 'notificationx'),
124 // 'tag_anonymous_title' => __('Anonymous Title' , 'notificationx'),
125 ],
126 'fourth_param' => [
127 'tag_time' => __('Definite Time', 'notificationx'),
128 'tag_sometime' => __('Some time ago', 'notificationx'),
129 ],
130 '_themes' => [
131 "{$this->id}_theme-one",
132 "{$this->id}_theme-two",
133 "{$this->id}_theme-three",
134 "{$this->id}_maps_theme",
135 ],
136 ],
137 ];
138 }
139
140 public function preview_entry($entry, $settings){
141 $entry = array_merge($entry, [
142 "title" => "NotificationX Pro",
143 ]);
144
145 if('email_subscription_maps_theme' !== $settings['theme']){
146 $entry['image_data'] = array(
147 'url' => NOTIFICATIONX_PUBLIC_URL . 'image/icons/pink-face-looped.gif',
148 'alt' => '',
149 'classes' => 'greview_icon',
150 );
151 }
152 return $entry;
153 }
154
155 }
156