def METHOD_NAME(secret_key):
	"""
	check if subscription is active on marketplace and valid
	#TODO: get activation date
	"""
	if not secret_key or not isinstance(secret_key, str):
		frappe.throw("Invalid Secret Key")
	if frappe.db.exists("Saas App Subscription", {"secret_key": secret_key}):
		return True
	plan_label_map = {"Mail 25$": 10000, "Mail 5$": 2000, "Mail Free": 100}
	try:
		subscription = get_subscription_info(secret_key=secret_key)
	except Exception as e:
		frappe.throw(e)
	if subscription["status"] == "Active":
		# TODO: add a date filter(use start date from plan)
		first_day = str(datetime.now().replace(day=1).date())
		count = frappe.db.count(
			"Mail Log",
			filters={
				"site": subscription["site"],
				"status": "delivered",
				"creation": (">=", first_day),
				"subscription_key": secret_key,
			},
		)
		if count < plan_label_map[subscription["plan"]]:
			return True
		else:
			frappe.throw(
				"Your plan for email delivery service has expired try upgrading it from, "
				f"https://frappecloud.com/dashboard/sites/{subscription['site']}/overview",
				PlanExpiredError,
			)
	return False