Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send success only IF HelpScout ticket was created? #26

Open
helgatheviking opened this issue Feb 23, 2023 · 0 comments
Open

Send success only IF HelpScout ticket was created? #26

helgatheviking opened this issue Feb 23, 2023 · 0 comments

Comments

@helgatheviking
Copy link
Contributor

Currently we send a success header if there's any action hook attached.... which there always is one set for the current API chosen in the settings. Instead, can we look at all at whether the ticket is actually handled successfully? Also we always return a -1 result... which isn't super handy when debuggin via postman. note to future self.

SendGrid payload needs adjusting to

	/**
	 * Get the webhook payload.
	 *
	 * @return  array - the $_POSTed data.
	 */
	public function get_payload() {

	    $payload = [];

        $payload_json = @file_get_contents('php://input');
        
        if ( !empty($payload_json ) ) {
            $payload = json_decode($payload_json, true);
        } elseif ( ! empty( $_POST ) ) {
            $payload = $_POST;
        }

	    return $payload;
		
	}

when testing via postman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant