-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed accounts api to send email in readme
- Loading branch information
1 parent
b38991a
commit bfd5c53
Showing
1 changed file
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
||
``` | ||
|
||
|