{"action":"created","issue":{"url":"https://api.github.com/repos/mautic/mautic/issues/1919","repository_url":"https://api.github.com/repos/mautic/mautic","labels_url":"https://api.github.com/repos/mautic/mautic/issues/1919/labels{/name}","comments_url":"https://api.github.com/repos/mautic/mautic/issues/1919/comments","events_url":"https://api.github.com/repos/mautic/mautic/issues/1919/events","html_url":"https://github.com/mautic/mautic/issues/1919","id":162849640,"number":1919,"title":"Custom code with help of webhook to send sms to user","user":{"login":"pramod1988","id":2357085,"avatar_url":"https://avatars.githubusercontent.com/u/2357085?v=3","gravatar_id":"","url":"https://api.github.com/users/pramod1988","html_url":"https://github.com/pramod1988","followers_url":"https://api.github.com/users/pramod1988/followers","following_url":"https://api.github.com/users/pramod1988/following{/other_user}","gists_url":"https://api.github.com/users/pramod1988/gists{/gist_id}","starred_url":"https://api.github.com/users/pramod1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pramod1988/subscriptions","organizations_url":"https://api.github.com/users/pramod1988/orgs","repos_url":"https://api.github.com/users/pramod1988/repos","events_url":"https://api.github.com/users/pramod1988/events{/privacy}","received_events_url":"https://api.github.com/users/pramod1988/received_events","type":"User","site_admin":false},"labels":[{"id":198196353,"url":"https://api.github.com/repos/mautic/mautic/labels/Pending%20Feedback","name":"Pending Feedback","color":"fad8c7","default":false}],"state":"closed","locked":false,"assignee":{"login":"dongilbert","id":718028,"avatar_url":"https://avatars.githubusercontent.com/u/718028?v=3","gravatar_id":"","url":"https://api.github.com/users/dongilbert","html_url":"https://github.com/dongilbert","followers_url":"https://api.github.com/users/dongilbert/followers","following_url":"https://api.github.com/users/dongilbert/following{/other_user}","gists_url":"https://api.github.com/users/dongilbert/gists{/gist_id}","starred_url":"https://api.github.com/users/dongilbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongilbert/subscriptions","organizations_url":"https://api.github.com/users/dongilbert/orgs","repos_url":"https://api.github.com/users/dongilbert/repos","events_url":"https://api.github.com/users/dongilbert/events{/privacy}","received_events_url":"https://api.github.com/users/dongilbert/received_events","type":"User","site_admin":false},"assignees":[{"login":"dongilbert","id":718028,"avatar_url":"https://avatars.githubusercontent.com/u/718028?v=3","gravatar_id":"","url":"https://api.github.com/users/dongilbert","html_url":"https://github.com/dongilbert","followers_url":"https://api.github.com/users/dongilbert/followers","following_url":"https://api.github.com/users/dongilbert/following{/other_user}","gists_url":"https://api.github.com/users/dongilbert/gists{/gist_id}","starred_url":"https://api.github.com/users/dongilbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongilbert/subscriptions","organizations_url":"https://api.github.com/users/dongilbert/orgs","repos_url":"https://api.github.com/users/dongilbert/repos","events_url":"https://api.github.com/users/dongilbert/events{/privacy}","received_events_url":"https://api.github.com/users/dongilbert/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-06-29T06:23:35Z","updated_at":"2017-02-03T19:59:44Z","closed_at":"2017-02-03T19:59:44Z","body":"I have setup webhook on mautic with webhook event form submit event. When i submit new form of mautic it gives me data in webhook in json but when i convert into array i don't get that data.\nHere is my code :- \n\n```\nclass webhookTest {\n    /**\n     * Log a message to a file\n     *\n     * @param  mixed $message\n     * @param  string $type [info|error|request]\n     */\n\n\n    function objectToArray($d) \n    {\n        if (is_object($d)) {\n            // Gets the properties of the given object\n            // with get_object_vars function\n            $d = get_object_vars($d);\n        }\n\n        if (is_array($d)) {\n            /*\n            * Return array converted to object\n            * Using __FUNCTION__ (Magic constant)\n            * for recursive call\n            */\n            return array_map(__FUNCTION__, $d);\n        } else {\n            // Return array\n            return $d;\n        }\n    }\n\n    public function log($message, $type = 'info')\n    {\n        date_default_timezone_set('Asia/Kolkata');\n\n        $obj = json_decode($message);\n\n        $new_array = $this->objectToArray($obj);\n\n        $phone = $new_array['mautic.form_on_submit'][0]['submission']['results']['phone'];\n\n        /*    Sms code will come here   */\n    }\n\n\n    public function getRequest()\n    {\n        $rawData = file_get_contents(\"php://input\");\n        $this->log($rawData, 'request');\n\n        return json_decode($rawData);\n    }\n}\n\n$webhook = new webhookTest;\n$requestData = $webhook->getRequest();\n```\n\nIf anyone help me in that it will be helpful for me.\n"},"comment":{"url":"https://api.github.com/repos/mautic/mautic/issues/comments/277347224","html_url":"https://github.com/mautic/mautic/issues/1919#issuecomment-277347224","issue_url":"https://api.github.com/repos/mautic/mautic/issues/1919","id":277347224,"user":{"login":"escopecz","id":1235442,"avatar_url":"https://avatars.githubusercontent.com/u/1235442?v=3","gravatar_id":"","url":"https://api.github.com/users/escopecz","html_url":"https://github.com/escopecz","followers_url":"https://api.github.com/users/escopecz/followers","following_url":"https://api.github.com/users/escopecz/following{/other_user}","gists_url":"https://api.github.com/users/escopecz/gists{/gist_id}","starred_url":"https://api.github.com/users/escopecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escopecz/subscriptions","organizations_url":"https://api.github.com/users/escopecz/orgs","repos_url":"https://api.github.com/users/escopecz/repos","events_url":"https://api.github.com/users/escopecz/events{/privacy}","received_events_url":"https://api.github.com/users/escopecz/received_events","type":"User","site_admin":false},"created_at":"2017-02-03T19:59:44Z","updated_at":"2017-02-03T19:59:44Z","body":"Closing for lack of answer. Feel free to comment with a new update and the issue will be opened again."}}
{"actor":{"display_login":"escopecz"}}