WP_SENDEMAIL::define_action()

Define and register the action by pushing it into the Automator object


Source

File: src/integrations/wp/actions/wp-sendemail.php

	 *
	 * @return void.
	 */
	protected function setup_action() {

		$this->set_integration( 'WP' );
		$this->set_action_code( 'SENDEMAIL' );
		$this->set_action_meta( 'EMAILTO' );

		/* translators: Action - WordPress */
		$this->set_sentence( sprintf( esc_attr__( 'Send an email to {{email address:%1$s}}', 'uncanny-automator' ), $this->get_action_meta() ) );

		/* translators: Action - WordPress */
		$this->set_readable_sentence( esc_attr__( 'Send an {{email}}', 'uncanny-automator' ) );

		$options_group = array(

			$this->get_action_meta() => array(

				// Email From Field.
				Automator()->helpers->recipe->field->text(
					array(
						'option_code' => 'EMAILFROM',
						/* translators: Email field */
						'label'       => esc_attr__( 'From', 'uncanny-automator' ),
						'input_type'  => 'email',
						'default'     => '{{admin_email}}',
					)
				),

				// Email From Field.
				Automator()->helpers->recipe->field->text(
					array(
						'option_code' => 'EMAILFROMNAME',
						/* translators: Email field */
						'label'       => esc_attr__( 'From name', 'uncanny-automator' ),
						'input_type'  => 'text',