<?php

/**
 * Free Showcase Integration Class
 */
namespace Simple_Giveaways;

if ( ! defined( 'ABSPATH' ) ) {
	return;
}

if ( ! class_exists( '\Simple_Giveaways\SG_Mailster_Dummy' ) ) {
	class SG_Mailster_Dummy extends GA_Integration {

		/**
		 * Active Indicator
		 *
		 * @var boolean
		 */
		public $active = false;

		/**
		 * Integration Image
		 *
		 * @var string
		 */
		public $image = '';

		/**
		 * Integration Title
		 *
		 * @var string
		 */
		public $title = '';

		/**
		 * Integration Description
		 *
		 * @var string
		 */
		public $desc = '';

		/**
		 * API URL
		 *
		 * @var string
		 */
		private $api_url = '';

		/**
		 * API Key
		 *
		 * @var string
		 */
		private $api_key = '';

		/**
		 * Request URL
		 *
		 * @var string
		 */
		private $request_url = '';

		/**
		 * Request Arguments
		 *
		 * @var array
		 */
		private $request_args = array();

		/**
		 * Metabox
		 *
		 * @var boolean
		 */
		private $metabox = false;

		/**
		 * Setting initial params
		 */
		public function __construct() {

			$this->title       = __( 'Mailster', 'giveasap' );
			$this->settings_id = 'sg_mailster';
			$this->image       = untrailingslashit( GASAP_URI ) . '/includes/integrations/assets/mailster-logo.png';
			$this->desc        = __( 'Sends users to your list and grow your email list using Mailster.', 'giveasap' );
		}

		public function buttons( $integrations ) {
			echo '<a href="' . esc_url( giv_fs()->get_upgrade_url() ) . '" class="button button-primary">' . esc_html__( 'Upgrade to PRO', 'giveasap' ) . '</a>';
		}

		/**
		 * Get Categories
		 *
		 * @return string[]
		 */
		public function get_categories() {
			return [
				'email',
				'marketing',
				'automation',
			];
		}
	}
}

add_filter( 'giveasap_integrations', '\Simple_Giveaways\sg_register_mailster' );

/**
 * Registering MailPoet
 *
 * @return array
 */
function sg_register_mailster( $integrations ) {

	$integrations['sg_mailster'] = '\Simple_Giveaways\SG_Mailster_Dummy';

	return $integrations;
}
