<?php

declare(strict_types=1);

/* webEdition CMS
 *
 * $Rev$
 * $Author$
 * $Date$
 *
 * This source is part of webEdition CMS. webEdition CMS is
 * free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * any later version.
 *
 * The GNU General Public License can be found at
 * https://www.gnu.org/licenses/gpl-3.0.html.
 * A copy is found in the textfile
 * webEdition/licenses/webEditionCMS/License.txt
 *
 * @license	https://www.gnu.org/licenses/gpl-3.0.html  GPL
 */

abstract class we_tag_newsletterSalutation extends we_weTag_tag{

	/**
	 * @param array<string,mixed> $attribs parsed tag-attributes
	 * @param string $content content between openingtag and closing tag @unused-param
	 * @param bool $internal if used by we internally @unused-param
	 * @throws we_exception_parser if any attribute is missing
	 */
	public static function tag(array $attribs = [], string $content = '', bool $internal = false): string{
		$type = trim(self::getAttribute('type', $attribs, '', we_base_request::STRING));
		return match($type){
			'customerid' => we_newsletter_util::$CUSTOMERID,
			'title' => we_newsletter_util::$TITLE,
			'firstname' => we_newsletter_util::$FIRSTNAME,
			'lastname' => we_newsletter_util::$LASTNAME,
			'email' => we_newsletter_util::$MAIL,
			//'salutation':
			default => we_newsletter_util::$SALUTATION,
		};
	}

}
