Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830
Action_Helpers_Email::set_mail_values( $data )


Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Parameters Parameters

$data

(Required)


Source Source

File: src/core/lib/recipe-parts/actions/trait-action-helpers-email.php

	public function set_mail_values( $data ) {
		$defaults = array(
			'from'      => Automator()->parse->text( '{{admin_email}}' ),
			'from_name' => Automator()->parse->text( '{{site_name}}' ),
			'to'        => Automator()->parse->text( '{{user_email}}' ),
			'cc'        => '',
			'bcc'       => '',
			'reply_to'  => '',
			'content'   => $this->get_content_type(),
			'charset'   => $this->get_charset(),
			'subject'   => '',
			'body'      => '',
		);
		$data = wp_parse_args( $data, $defaults );
		$from_email = sanitize_email( $data['from'] );
		$from_name  = sanitize_text_field( $data['from_name'] );
		$to_email   = sanitize_email( $data['to'] );
		$cc_email   = sanitize_email( $data['cc'] );
		$bcc_email  = sanitize_email( $data['bcc'] );
		$reply_to   = sanitize_email( $data['reply_to'] );
		$content    = sanitize_text_field( $data['content'] );
		$charset    = sanitize_text_field( $data['charset'] );
		$subject    = sanitize_text_field( stripslashes( $data['subject'] ) );
		$body       = wp_filter_post_kses( stripslashes( $data['body'] ) );
		$this->set_to( $to_email );
		$this->set_from( $from_email );
		$this->set_from_name( $from_name );
		$this->set_reply_to( $reply_to );
		$this->set_cc( $cc_email );
		$this->set_bcc( $bcc_email );
		$this->set_content_type( $content );
		$this->set_charset( $charset );
		$this->set_subject( $subject );
		$this->set_body( $body );
	}