{"action":"created","issue":{"url":"https://api.github.com/repos/sendgrid/sendgrid-python/issues/59","repository_url":"https://api.github.com/repos/sendgrid/sendgrid-python","labels_url":"https://api.github.com/repos/sendgrid/sendgrid-python/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/sendgrid/sendgrid-python/issues/59/comments","events_url":"https://api.github.com/repos/sendgrid/sendgrid-python/issues/59/events","html_url":"https://github.com/sendgrid/sendgrid-python/issues/59","id":30080536,"number":59,"title":"Distributed example code incompatible with current library.","user":{"login":"chasrmartin","id":86798,"avatar_url":"https://avatars.githubusercontent.com/u/86798?v=3","gravatar_id":"","url":"https://api.github.com/users/chasrmartin","html_url":"https://github.com/chasrmartin","followers_url":"https://api.github.com/users/chasrmartin/followers","following_url":"https://api.github.com/users/chasrmartin/following{/other_user}","gists_url":"https://api.github.com/users/chasrmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/chasrmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chasrmartin/subscriptions","organizations_url":"https://api.github.com/users/chasrmartin/orgs","repos_url":"https://api.github.com/users/chasrmartin/repos","events_url":"https://api.github.com/users/chasrmartin/events{/privacy}","received_events_url":"https://api.github.com/users/chasrmartin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2014-03-24T22:14:09Z","updated_at":"2016-09-22T00:21:27Z","closed_at":"2014-03-24T22:30:17Z","body":"Here's the results of running the example you're distributing:\r\n\r\n```\r\n(sendgrid)bash $ python sg-example.py \r\nTraceback (most recent call last):\r\n  File \"sg-example.py\", line 23, in <module>\r\n    s = sendgrid.Sendgrid(sg_username, sg_password, secure=True)\r\nAttributeError: 'module' object has no attribute 'Sendgrid'\r\n```\r\n\r\nHere's the example program:\r\n\r\n```\r\n\r\n#\r\n# SendGrid Python Example (SendGrid Python Library)\r\n#\r\n# This example shows how to send email through SendGrid\r\n# using Python and the SendGrid Python Library.  For \r\n# more information on the SendGrid Library, visit:\r\n#\r\n#     https://github.com/sendgrid/sendgrid-python\r\n#\r\n#\r\n\r\nimport sendgrid\r\nimport json\r\n\r\n\r\n# MAKE A SECURE CONNECTION TO SENDGRID\r\n# Fill in the variables below with your SendGrid \r\n# username and password.\r\n#========================================================#\r\nsg_username = \"your_sendgrid_username\"\r\nsg_password = \"your_sendgrid_password\"\r\ns = sendgrid.Sendgrid(sg_username, sg_password, secure=True)\r\n\r\n\r\n# ENTER THE EMAIL INFORMATION\r\n#========================================================#\r\nfrom_address = \"your_from_address@domain.none\"\r\nsubject = \"Subject here!\"\r\nbody_text = \"Hello,\\n\\nThis is a test message from SendGrid.  We have sent this to you because you requested a test message be sent from your account.\\n\\nThis is a link to google.com: http://www.google.com\\nThis is a link to apple.com: http://www.apple.com\\nThis is a link to sendgrid.com: http://www.sendgrid.com\\n\\nThank you for reading this test message.\\n\\nLove,\\nYour friends at SendGrid\"\r\nbody_html = \"<table style=\\\"border: solid 1px #000; background-color: #666; font-family: verdana, tahoma, sans-serif; color: #fff;\\\"> <tr> <td> <h2>Hello,</h2> <p>This is a test message from SendGrid.  We have sent this to you because you requested a test message be sent from your account.</p> <a href=\\\"http://www.google.com\\\" target=\\\"_blank\\\">This is a link to google.com</a> <p> <a href=\\\"http://www.apple.com\\\" target=\\\"_blank\\\">This is a link to apple.com</a> <p> <a href=\\\"http://www.sendgrid.com\\\" target=\\\"_blank\\\">This is a link to sendgrid.com</a> </p> <p>Thank you for reading this test message.</p> Love,<br/> Your friends at SendGrid</p> <p> <img src=\\\"http://sendgrid.com/wp-content/themes/sendgridNew/images/sendgrid-logo.png\\\" alt=\\\"SendGrid!\\\" /> </td> </tr> </table>\"\r\n\r\n\r\n# CREATE THE SENDGRID MAIL OBJECT\r\n#========================================================#\r\nmessage = sendgrid.Message(from_address, subject, body_text, body_html)\r\n\r\n\r\n# SMTP API\r\n#========================================================#\r\nsmtpapi = {\r\n    \"sub\": {\r\n        \"%new_tag_1%\": [\r\n            \"New Value 1\"\r\n        ],\r\n        \"%new_tag_2%\": [\r\n            \"New Value 2\"\r\n        ]\r\n    },\r\n    \"to\": [\r\n        \"New Person 1 <new1@email.none>\",\r\n        \"New Person 2 <new2@email.none>\",\r\n        \"New Person 3 <new3@email.none>\"\r\n    ],\r\n    \"category\": [\r\n        \"Category 1\",\r\n        \"Category 2\"\r\n    ],\r\n    \"unique_args\": {\r\n        \"New Argument 2\": \"New Value 2\",\r\n        \"New Argument 1\": \"New Value 1\"\r\n    }\r\n}\r\nmessage.add_header(\"X-SMTPAPI\", json.dumps(smtpapi, separators=(',',':')))\r\n\r\n\r\n# ADD A RECIPIENT\r\n#========================================================#\r\nmessage.add_to(\"recipient_email@domain.none\")\r\n\r\n\r\n# USE SMTP TO SEND YOUR MESSAGE\r\n#========================================================#\r\ns.smtp.send(message)\r\n# ALTERNATIVELY YOU CAN USE THE WEB API BY USING THIS:\r\n# s.web.send(message)\r\n\r\n\r\nprint \"Sent email successfully\"\r\n```"},"comment":{"url":"https://api.github.com/repos/sendgrid/sendgrid-python/issues/comments/248780248","html_url":"https://github.com/sendgrid/sendgrid-python/issues/59#issuecomment-248780248","issue_url":"https://api.github.com/repos/sendgrid/sendgrid-python/issues/59","id":248780248,"user":{"login":"thinkingserious","id":146695,"avatar_url":"https://avatars.githubusercontent.com/u/146695?v=3","gravatar_id":"","url":"https://api.github.com/users/thinkingserious","html_url":"https://github.com/thinkingserious","followers_url":"https://api.github.com/users/thinkingserious/followers","following_url":"https://api.github.com/users/thinkingserious/following{/other_user}","gists_url":"https://api.github.com/users/thinkingserious/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkingserious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkingserious/subscriptions","organizations_url":"https://api.github.com/users/thinkingserious/orgs","repos_url":"https://api.github.com/users/thinkingserious/repos","events_url":"https://api.github.com/users/thinkingserious/events{/privacy}","received_events_url":"https://api.github.com/users/thinkingserious/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T00:21:26Z","updated_at":"2016-09-22T00:21:26Z","body":"@vinaysprabhu,\r\n\r\nHave you tried the installation steps here? https://github.com/sendgrid/sendgrid-python#installation"}}
{"actor":{"display_login":"thinkingserious"}}