LLMS_MailHawk::output_js( $additional_js = '' )

Output some quick and dirty inline JS.


Return Return

(void)


Top ↑

Source Source

File: includes/admin/class-llms-mailhawk.php

	public function output_js( $additional_js = '' ) {

		if ( ! $this->should_output_inline() ) {
			return;
		}

		?>
		<script>
			jQuery( '#llms-mailhawk-connect' ).on( 'click', function( e ) {

				e.preventDefault();

				LLMS.Spinner.start( jQuery( this ), 'small' );

				var data = {
					action: 'llms_mailhawk_remote_install',
					_llms_mailhawk_nonce: '<?php echo wp_create_nonce( 'llms-mailhawk-install' ); ?>',
				};

				window.llms.emailConnectors.remoteInstall( jQuery( this ), data, function( res ) {

					window.llms.emailConnectors.registerClient( res.register_url, {
						'mailhawk_plugin_signup': 'yes',
						'state': res.client_state,
						'redirect_uri': res.redirect_uri,
						'partner_id': res.partner_id
					} );

				} );

			} );
		</script>
		<?php

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.40.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.