{"action":"created","issue":{"url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/644","repository_url":"https://api.github.com/repos/sendgrid/sendgrid-php","labels_url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/644/labels{/name}","comments_url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/644/comments","events_url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/644/events","html_url":"https://github.com/sendgrid/sendgrid-php/issues/644","id":342836808,"node_id":"MDU6SXNzdWUzNDI4MzY4MDg=","number":644,"title":"Provide solution for \"Class 'SendGrid\\Client' not found\" error, which occurs when files are missing","user":{"login":"richgcook","id":901289,"node_id":"MDQ6VXNlcjkwMTI4OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/901289?v=4","gravatar_id":"","url":"https://api.github.com/users/richgcook","html_url":"https://github.com/richgcook","followers_url":"https://api.github.com/users/richgcook/followers","following_url":"https://api.github.com/users/richgcook/following{/other_user}","gists_url":"https://api.github.com/users/richgcook/gists{/gist_id}","starred_url":"https://api.github.com/users/richgcook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richgcook/subscriptions","organizations_url":"https://api.github.com/users/richgcook/orgs","repos_url":"https://api.github.com/users/richgcook/repos","events_url":"https://api.github.com/users/richgcook/events{/privacy}","received_events_url":"https://api.github.com/users/richgcook/received_events","type":"User","site_admin":false},"labels":[{"id":674389631,"node_id":"MDU6TGFiZWw2NzQzODk2MzE=","url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/difficulty:%20easy","name":"difficulty: easy","color":"c2e0c6","default":false},{"id":726229562,"node_id":"MDU6TGFiZWw3MjYyMjk1NjI=","url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/good%20first%20issue","name":"good first issue","color":"e6e6e6","default":true},{"id":455065778,"node_id":"MDU6TGFiZWw0NTUwNjU3Nzg=","url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/hacktoberfest","name":"hacktoberfest","color":"ffa500","default":false},{"id":726229557,"node_id":"MDU6TGFiZWw3MjYyMjk1NTc=","url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/help%20wanted","name":"help wanted","color":"e6e6e6","default":true},{"id":378656146,"node_id":"MDU6TGFiZWwzNzg2NTYxNDY=","url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/status:%20help%20wanted","name":"status: help wanted","color":"cccccc","default":false},{"id":23680158,"node_id":"MDU6TGFiZWwyMzY4MDE1OA==","url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/type:%20question","name":"type: question","color":"fbca04","default":false},{"id":736833785,"node_id":"MDU6TGFiZWw3MzY4MzM3ODU=","url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/up%20for%20grabs","name":"up for grabs","color":"e6e6e6","default":false},{"id":726229551,"node_id":"MDU6TGFiZWw3MjYyMjk1NTE=","url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/up-for-grabs","name":"up-for-grabs","color":"e6e6e6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2018-07-19T18:18:01Z","updated_at":"2018-10-24T04:17:51Z","closed_at":null,"author_association":"NONE","body":"I am getting the following error on form submission\r\n\r\n`Class 'SendGrid\\Client' not found`\r\n\r\nI am upgrading from v2 to v3 (v2 worked fine) and I am not using composer.\r\n\r\nAny thoughts?\r\n\r\n```\r\nrequire_once($this->config->paths->root . 'api/sendgrid/lib/loader.php');\r\n\r\n\tif ($this->input->post->action == 'enquiryForm') {\r\n\r\n \t\tif ($_POST['products']) {\r\n\r\n \t\t\tforeach ($_POST['products'] as $item) {\r\n \t\t\t\tif (is_array($item)) {\r\n \t\t\t\t\t$products[] = $item;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tif ($_POST['formFields']) {\r\n \t\t\tparse_str($_POST['formFields'], $user_details);\r\n \t\t}\r\n\r\n\t\tob_start();\r\n\t\t   require_once('../../api/template--enquiry.php');\r\n\t\t   $body = ob_get_contents();\r\n\t\tob_end_clean();\r\n\r\n\t\t$email = new \\SendGrid\\Mail\\Mail();\r\n\t\t$email->setFrom($user_details['email'], null);\r\n\t\t$tos = [\r\n\t\t    \"rich@****.***\" => null\r\n\t\t];\r\n\t\t$email->addTos($tos);\r\n\t\t$email->setSubject(\"Sending with SendGrid is Fun\");\r\n\t\t$email->addContent(\r\n\t\t    \"text/html\", $body\r\n\t\t);\r\n\t\t$sendgrid = new \\SendGrid(getenv('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'));\r\n\t\ttry {\r\n\t\t    $response = $sendgrid->send($email);\r\n\t\t    print $response->statusCode() . \"\\n\";\r\n\t\t    print_r($response->headers());\r\n\t\t    print $response->body() . \"\\n\";\r\n\t\t} catch (Exception $e) {\r\n\t\t    echo 'Caught exception: ',  $e->getMessage(), \"\\n\";\r\n\t\t}\r\n\r\n\t}\r\n\r\n```\r\n\r\nI am using PHP 7.1 and latest commit 2889b96 (although as I am not using composer I had to add the following push requests: https://github.com/sendgrid/sendgrid-php/pull/633"},"comment":{"url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/comments/432507119","html_url":"https://github.com/sendgrid/sendgrid-php/issues/644#issuecomment-432507119","issue_url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/644","id":432507119,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjUwNzExOQ==","user":{"login":"mkasberg","id":12214617,"node_id":"MDQ6VXNlcjEyMjE0NjE3","avatar_url":"https://avatars1.githubusercontent.com/u/12214617?v=4","gravatar_id":"","url":"https://api.github.com/users/mkasberg","html_url":"https://github.com/mkasberg","followers_url":"https://api.github.com/users/mkasberg/followers","following_url":"https://api.github.com/users/mkasberg/following{/other_user}","gists_url":"https://api.github.com/users/mkasberg/gists{/gist_id}","starred_url":"https://api.github.com/users/mkasberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkasberg/subscriptions","organizations_url":"https://api.github.com/users/mkasberg/orgs","repos_url":"https://api.github.com/users/mkasberg/repos","events_url":"https://api.github.com/users/mkasberg/events{/privacy}","received_events_url":"https://api.github.com/users/mkasberg/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T04:17:51Z","updated_at":"2018-10-24T04:17:51Z","author_association":"NONE","body":"Can you expand on that a little?\r\n\r\nHow does \"loading required classes manually\" do you any good when you're missing the `SendGrid\\Client` class? I did reproduce the issue on my own machine, and I resolved it by running `composer install` and using `sendgrid-php.php` instead of `loader.php`."}}
{"actor":{"display_login":"mkasberg"}}