Skip to content

Unclear default data #178

Description

@tharrington

I find the examples difficult to run because they are unclear on what is needed (specifically https://github.com/sendgrid/sendgrid-python/blob/master/examples/mail/mail.py).

All I am trying to do is send a simple email with one of my transactional email templates:

sg = sendgrid.SendGridAPIClient(apikey='mykey')

def send_email(to, template):
    data = {
        'from': {
            'email': "welcome@mydomain.com",
            'name': "Hello"
        },
        'personalizations': [{
            'to': [
                {
                    'email': "test@mydomain.com",
                    'name': "test"
                }
            ]
        }],
        'subject': "Welcome ",
        'template_id': "my template id"
    }
    response = sg.client.mail.send.post(request_body=data)
    print(response.status_code)
    print(response.body)
    print(response.headers)

But this throws an attribute error:

AttributeError: class addinfourl has no attribute 'mro'

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: help wantedrequesting help from the communitytype: questionquestion directed at the library

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions