Automator_Send_Webhook_Fields::buttons( $action_meta, string $support_link = 'https://automatorplugin.com/knowledge-base/send-data-to-a-webhook/?utm_source=uncanny_automator&utm_medium=automator-send_data_to_webhook&utm_content=help_button' )

Return buttons for webhooks


Parameters Parameters

$action_meta

(Required)

$support_link

(Optional)

Default value: 'https://automatorplugin.com/knowledge-base/send-data-to-a-webhook/?utm_source=uncanny_automator&utm_medium=automator-send_data_to_webhook&utm_content=help_button'


Top ↑

Return Return

(array)


Source Source

File: src/core/lib/webhooks/class-automator-send-webhook-fields.php

	public function buttons( $action_meta, $support_link = 'https://automatorplugin.com/knowledge-base/send-data-to-a-webhook/?utm_source=uncanny_automator&utm_medium=automator-send_data_to_webhook&utm_content=help_button' ) {
		return array(
			array(
				'show_in'     => $action_meta,
				'text'        => esc_attr__( 'Help', 'uncanny-automator' ),
				'css_classes' => 'uap-btn uap-btn--transparent',
				'on_click'    => 'function(){ window.open( "' . esc_url_raw( $support_link ) . '", "_blank" ); }',
			),
			array(
				'show_in'     => $action_meta,
				'text'        => esc_attr__( 'Check data format', 'uncanny-automator' ),
				'css_classes' => 'uap-btn uap-btn--primary',
				'on_click'    => Automator()->send_webhook->build_sample_data(),
				'modules'     => array( 'markdown' ),
			),
			array(
				'show_in'     => $action_meta,
				/* translators: Non-personal infinitive verb */
				'text'        => esc_attr__( 'Send test', 'uncanny-automator' ),
				'css_classes' => 'uap-btn uap-btn--red',
				'on_click'    => Automator()->send_webhook->send_test_js(),
				'modules'     => array( 'markdown' ),
			),
		);
	}