<?php
/**
 * @copyright (C) 2016 - 2025 Holger Brandt IT Solutions
 * @license GNU/GPL, see license.txt
 * WP Mailster is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License 2
 * as published by the Free Software Foundation.
 *
 * WP Mailster is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with WP Mailster; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 * or see http://www.gnu.org/licenses/.
 */


/* @@REMOVE_START_MST_free@@ */
/* @@REMOVE_START_MST_club@@ */

$task = sanitize_text_field($_GET["task"]);
$key = sanitize_text_field($_GET["key"]);
if( $key == get_option('wpmst_cfg_cron_job_key') ) {
	include_once "cronClass.php";
	$Cron = new MailsterControllerCron();

	switch ($task) {
		case 'fetchall':
			$Cron->fetchall();
			break;
		case 'fetch':
			$Cron->fetch();
			break;
		case 'send':
			$Cron->send();
			break;
		case 'all':
			$Cron->all();
			break;
		default:
			echo "Invalid cron job TASK";
			break;
	}
} else {
	echo "Invalid cron job KEY";
}

/* @@REMOVE_END_MST_club@@ */
/* @@REMOVE_END_MST_free@@ */


/*  */
