Skip to content

Commit 1fb507a

Browse files
Ihor BilousIhor Bilous
authored andcommitted
Fix issue #52: Fix typo, update sending examples
1 parent 6e173c3 commit 1fb507a

File tree

7 files changed

+15
-3
lines changed

7 files changed

+15
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Remove the inbox_id field or set it to None. Then, remove the sandbox field or s
5454
You can change the arguments in the code or via another way. Here is an example using environment variables.
5555

5656
Set next environment variables:
57-
```
57+
```bash
5858
MAILTRAP_API_KEY=your_api_token # https://mailtrap.io/api-tokens
5959
MAILTRAP_USE_SANDBOX=true # true/false toggle
6060
MAILTRAP_INBOX_ID=123456 # Only needed for sandbox
@@ -186,7 +186,7 @@ Refer to the [examples](examples) folder for the source code of this and other a
186186
### Batch Sending API
187187
- [Batch sending minimal](examples/sending/batch_minimal_sending.py)
188188
- [Batch sending advanced](examples/sending/batch_advanced_sending.py)
189-
- [Bathc sending using template](examples/sending/batch_sending_with_template.py)
189+
- [Batch sending using template](examples/sending/batch_sending_with_template.py)
190190

191191
### Sandbox (Email Testing) API
192192
- [Attachments](examples/testing/attachments.py)
@@ -261,7 +261,7 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/mailtra
261261
#### Clone the repo
262262

263263
```bash
264-
https://github.com/mailtrap/mailtrap-python.git
264+
git clone https://github.com/mailtrap/mailtrap-python.git
265265
cd mailtrap-python
266266
```
267267

examples/sending/advanced_sending.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def get_client(type_: SendingType) -> mt.MailtrapClient:
2323
sandbox=True,
2424
inbox_id="<YOUR_INBOX_ID>",
2525
)
26+
else:
27+
raise ValueError(f"Invalid sending type: {type_}")
2628

2729

2830
# Image should be in the same level in directory like this python file.

examples/sending/batch_advanced_sending.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def get_client(type_: SendingType) -> mt.MailtrapClient:
2323
sandbox=True,
2424
inbox_id="<YOUR_INBOX_ID>",
2525
)
26+
else:
27+
raise ValueError(f"Invalid sending type: {type_}")
2628

2729

2830
# Image should be in the same level in directory like this python file.

examples/sending/batch_minimal_sending.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def get_client(type_: SendingType) -> mt.MailtrapClient:
1818
return mt.MailtrapClient(
1919
token=API_TOKEN, sandbox=True, inbox_id="<YOUR_INBOX_ID>"
2020
)
21+
else:
22+
raise ValueError(f"Invalid sending type: {type_}")
2123

2224

2325
batch_mail = mt.BatchSendEmailParams(

examples/sending/batch_sending_with_template.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def get_client(type_: SendingType) -> mt.MailtrapClient:
1818
return mt.MailtrapClient(
1919
token=API_TOKEN, sandbox=True, inbox_id="<YOUR_INBOX_ID>"
2020
)
21+
else:
22+
raise ValueError(f"Invalid sending type: {type_}")
2123

2224

2325
batch_mail = mt.BatchSendEmailParams(

examples/sending/minimal_sending.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def get_client(type_: SendingType) -> mt.MailtrapClient:
1818
return mt.MailtrapClient(
1919
token=API_TOKEN, sandbox=True, inbox_id="<YOUR_INBOX_ID>"
2020
)
21+
else:
22+
raise ValueError(f"Invalid sending type: {type_}")
2123

2224

2325
mail = mt.Mail(

examples/sending/sending_with_template.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def get_client(type_: SendingType) -> mt.MailtrapClient:
1818
return mt.MailtrapClient(
1919
token=API_TOKEN, sandbox=True, inbox_id="<YOUR_INBOX_ID>"
2020
)
21+
else:
22+
raise ValueError(f"Invalid sending type: {type_}")
2123

2224

2325
mail = mt.MailFromTemplate(

0 commit comments

Comments
 (0)