Helper::__construct( string $event, array $args = array() )

Description #

Initialize email class.

Parameters #

  • $event
    string (Required) Event name.
  • $args
    array (Optional) Arguments. Default value: array()

Source #

File: addons/email/class-helper.php

	public function __construct( $event, $args = array() ) {
		$this->event = $event;

		$this->args = ap_parse_args(
			$args,
			array(
				'users'    => array(),
				'subject'  => '',
				'tags'     => array(
					'site_name'        => get_bloginfo( 'name' ),
					'site_url'         => get_bloginfo( 'url' ),
					'site_description' => get_bloginfo( 'description' ),
				),
				'template' => array(),
				'headers'  => array(
					'Content-Type: text/html; charset=utf-8',
				),
			)
		);

		$this->email_headers = $this->args['headers'];
		unset( $this->args['headers'] );

		// Add template tags.
		if ( ! empty( $this->args['tags'] ) ) {
			foreach ( $this->args['tags'] as $tag => $content ) {
				$this->add_template_tag( $tag, $content );
			}
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment