| @@ -1,0 +1,89 @@ | ||
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Zapier Extension | |
| 4 | + * | |
| 5 | + * @package NotificationX\Extensions | |
| 6 | + */ | |
| 7 | + | |
| 8 | +namespace NotificationX\Extensions\Zapier; | |
| 9 | + | |
| 10 | +use NotificationX\GetInstance; | |
| 11 | +use NotificationX\Extensions\Extension; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * Zapier Extension | |
| 15 | + * @method static ZapierConversions get_instance($args = null) | |
| 16 | + */ | |
| 17 | +class ZapierConversions extends Extension { | |
| 18 | + /** | |
| 19 | + * Instance of Zapier | |
| 20 | + * | |
| 21 | + * @var Zapier | |
| 22 | + */ | |
| 23 | + use GetInstance; | |
| 24 | + use Zapier; | |
| 25 | + | |
| 26 | + public $priority = 20; | |
| 27 | + public $id = 'zapier_conversions'; | |
| 28 | + public $img = NOTIFICATIONX_ADMIN_URL . 'images/extensions/sources/zapier.png'; | |
| 29 | + public $doc_link = 'https://notificationx.com/docs/zapier-notification-alert/'; | |
| 30 | + public $types = 'conversions'; | |
| 31 | + public $module = 'modules_zapier'; | |
| 32 | + public $is_pro = true; | |
| 33 | + public $module_priority = 16; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * Initially Invoked when initialized. | |
| 37 | + */ | |
| 38 | + public function __construct(){ | |
| 39 | + parent::__construct(); | |
| 40 | + } | |
| 41 | + | |
| 42 | + public function init_extension() | |
| 43 | + { | |
| 44 | + $this->title = __('Zapier', 'notificationx'); | |
| 45 | + $this->module_title = __('Zapier', 'notificationx'); | |
| 46 | + $this->popup = [ | |
| 47 | + "denyButtonText" => __("<a href='https://notificationx.com/docs/zapier-notification-alert/' target='_blank'>More Info</a>", "notificationx"), | |
| 48 | + "confirmButtonText" => __("<a href='https://notificationx.com/#pricing' target='_blank'>Upgrade to PRO</a>", "notificationx"), | |
| 49 | + "html"=> __(' | |
| 50 | + <span>A well-known web-based tool to connect with any of your web-based applications & boost productivity.</span> | |
| 51 | + <iframe id="email_subscription_video" type="text/html" allowfullscreen width="450" height="235" | |
| 52 | + src="https://www.youtube.com/embed/KjdLv5YMByQ"> | |
| 53 | + </iframe> | |
| 54 | + ', 'notificationx') | |
| 55 | + ]; | |
| 56 | + } | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * Get data for Zapier Extension. | |
| 60 | + * | |
| 61 | + * @param array $args Settings arguments. | |
| 62 | + * @return array | |
| 63 | + */ | |
| 64 | + public function get_data( $args = array() ){ | |
| 65 | + return 'Hello From Zapier'; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public function _doc(){ | |
| 69 | + return ' | |
| 70 | + <ul class="conversions nx-template-keys"> | |
| 71 | + <li><span>' . __('Field Name:', 'notificationx') . '</span> <strong>' . __('Field Key', 'notificationx') . '</strong></li> | |
| 72 | + <li><span>' . __('Full Name:', 'notificationx') . '</span> <strong>name</strong></li> | |
| 73 | + <li><span>' . __('First Name:', 'notificationx') . '</span> <strong>first_name</strong></li> | |
| 74 | + <li><span>' . __('Last Name:', 'notificationx') . '</span> <strong>last_name</strong></li> | |
| 75 | + <li><span>' . __('Sales Count:', 'notificationx') . '</span> <strong>sales_count</strong></li> | |
| 76 | + <li><span>' . __('Customer Email:', 'notificationx') . '</span> <strong>email</strong></li> | |
| 77 | + <li><span>' . __('Title, Product Title:', 'notificationx') . '</span> <strong>title</strong></li> | |
| 78 | + <li><span>' . __('Anonymous Title, Product:', 'notificationx') . '</span> <strong>anonymous_title</strong></li> | |
| 79 | + <li><span>' . __('Definite Time:', 'notificationx') . '</span> <strong>timestamp</strong></li> | |
| 80 | + <li><span>' . __('Sometime:', 'notificationx') . '</span> <strong>sometime</strong></li> | |
| 81 | + <li><span>' . __('In last 1 day:', 'notificationx') . '</span> <strong>1day</strong></li> | |
| 82 | + <li><span>' . __('In last 7 days:', 'notificationx') . '</span> <strong>7days</strong></li> | |
| 83 | + <li><span>' . __('In last 30 days:', 'notificationx') . '</span> <strong>30days</strong></li> | |
| 84 | + <li><span>' . __('City:', 'notificationx') . '</span> <strong>city</strong></li> | |
| 85 | + <li><span>' . __('Country:', 'notificationx') . '</span> <strong>country</strong></li> | |
| 86 | + <li><span>' . __('City,Country:', 'notificationx') . '</span> <strong>city_country</strong></li> | |
| 87 | + </ul>'; | |
| 88 | + } | |
| 89 | +} | |