{"action":"created","issue":{"url":"https://api.github.com/repos/sendgrid/sendgrid-nodejs/issues/341","repository_url":"https://api.github.com/repos/sendgrid/sendgrid-nodejs","labels_url":"https://api.github.com/repos/sendgrid/sendgrid-nodejs/issues/341/labels{/name}","comments_url":"https://api.github.com/repos/sendgrid/sendgrid-nodejs/issues/341/comments","events_url":"https://api.github.com/repos/sendgrid/sendgrid-nodejs/issues/341/events","html_url":"https://github.com/sendgrid/sendgrid-nodejs/issues/341","id":190910732,"number":341,"title":"I can not send emails in php sendgrid api","user":{"login":"ramp07860","id":23649463,"avatar_url":"https://avatars.githubusercontent.com/u/23649463?v=3","gravatar_id":"","url":"https://api.github.com/users/ramp07860","html_url":"https://github.com/ramp07860","followers_url":"https://api.github.com/users/ramp07860/followers","following_url":"https://api.github.com/users/ramp07860/following{/other_user}","gists_url":"https://api.github.com/users/ramp07860/gists{/gist_id}","starred_url":"https://api.github.com/users/ramp07860/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramp07860/subscriptions","organizations_url":"https://api.github.com/users/ramp07860/orgs","repos_url":"https://api.github.com/users/ramp07860/repos","events_url":"https://api.github.com/users/ramp07860/events{/privacy}","received_events_url":"https://api.github.com/users/ramp07860/received_events","type":"User","site_admin":false},"labels":[{"id":23244126,"url":"https://api.github.com/repos/sendgrid/sendgrid-nodejs/labels/type:%20question","name":"type: question","color":"d7e102","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-22T05:28:10Z","updated_at":"2016-11-29T06:35:33Z","closed_at":null,"body":"i got error with special character like single quotes\r\n\r\n{\"errors\":[{\"message\":\"Content-Type should be application/json.\",\"field\":null,\"help\":null}]}{\"errors\":[{\"message\":\"Content-Type should be application/json.\",\"field\":null,\"help\":null}]}415\r\n\r\nActually i can use sendgrid api for forward rss feeds news to our friends. \r\n\r\nmycode here\r\n//---------------------------------------------------------------------\r\nfunction sendMail($to_array, $sub, $from, $cnt){\r\n\r\nrequire 'vendor/autoload.php';\r\n$apiKey = 'SG.xxx';\r\n$sg = new \\SendGrid($apiKey);\r\n\r\nforeach ($to_array as $key => $emails) {\r\n \r\n    $request_body = json_decode('{\r\n      \"personalizations\": [\r\n        {\r\n          \"to\": [\r\n            {\r\n              \"email\": \"'.$emails.'\"\r\n            }\r\n          ],\r\n          \"subject\": \"'.$sub.'\"\r\n        }\r\n      ],\r\n      \"from\": {\r\n        \"email\": \"'.$from.'\"\r\n      },\r\n      \"content\": [\r\n        {\r\n          \"type\": \"text/html\",\r\n          \"value\": \"'.mysql_real_escape_string($cnt_new).'\"\r\n        }\r\n      ]\r\n    }');\r\n\r\n\r\n      $response = $sg->client->mail()->send()->post($request_body);\r\n      echo  $res=$response->statusCode();\r\n      echo $response->body();\r\n\r\n}\r\n  return $res;\r\n}\r\n\r\n\r\n//----------------------------------------------------------------------------------------------\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sendgrid/sendgrid-nodejs/issues/comments/263488909","html_url":"https://github.com/sendgrid/sendgrid-nodejs/issues/341#issuecomment-263488909","issue_url":"https://api.github.com/repos/sendgrid/sendgrid-nodejs/issues/341","id":263488909,"user":{"login":"manu-silicon","id":13194660,"avatar_url":"https://avatars.githubusercontent.com/u/13194660?v=3","gravatar_id":"","url":"https://api.github.com/users/manu-silicon","html_url":"https://github.com/manu-silicon","followers_url":"https://api.github.com/users/manu-silicon/followers","following_url":"https://api.github.com/users/manu-silicon/following{/other_user}","gists_url":"https://api.github.com/users/manu-silicon/gists{/gist_id}","starred_url":"https://api.github.com/users/manu-silicon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manu-silicon/subscriptions","organizations_url":"https://api.github.com/users/manu-silicon/orgs","repos_url":"https://api.github.com/users/manu-silicon/repos","events_url":"https://api.github.com/users/manu-silicon/events{/privacy}","received_events_url":"https://api.github.com/users/manu-silicon/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T06:35:33Z","updated_at":"2016-11-29T06:35:33Z","body":"@thinkingserious I managed to make it work but unfortunately I did not keep the non-working code. But I think I incorrectly constructed the request by using `content` instead of `body`:\r\n\r\n```\r\nvar request = sendgrid.emptyRequest({\r\n    method: 'POST',\r\n    path: '/v3/mail/send',\r\n    body: request_body_object\r\n});\r\n```"}}
{"actor":{"display_login":"manu-silicon"}}