Skip to content

Commit

Permalink
Changed accounts api to send email in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
itabrezshaikh authored Feb 4, 2021
1 parent b38991a commit bfd5c53
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,23 @@ configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = MimePost.AccountsApi(MimePost.ApiClient(configuration))
api_instance = MimePost.EmailsApi(MimePost.ApiClient(configuration))

to_email = MimePost.EmailTo(email = "[email protected]");

body = MimePost.Email(
subject = "Test email sent using MimePost Python SDK",
from_email = "[email protected]",
html = "<p>This is a body of the test email sent using MimePost Python SDK</p>",
to = [to_email],
) # Email | Single Email object

try:
# Get account profile details
api_response = api_instance.account_profile_get()
# Send email
api_response = api_instance.send_email(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountsApi->account_profile_get: %s\n" % e)
print("Exception when calling EmailsApi->send_email: %s\n" % e)

```

Expand Down

0 comments on commit bfd5c53

Please sign in to comment.