-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from chirag-jn/dev
Add support for App Passwords and secure app access
- Loading branch information
Showing
7 changed files
with
24 additions
and
12 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Notipyer | ||
##### Notification triggers for Python | ||
##### Notification Triggers for Python | ||
Send async email notifications via Python. Get updates/crashlogs from your scripts with ease. | ||
|
||
## Installation | ||
|
@@ -10,15 +10,19 @@ pip install notipyer | |
``` | ||
|
||
## Email Notifications | ||
Notipyer currently supports Gmail accounts as senders. To allow the library to use your gmail account, make the following changes: | ||
1. Turn off 2-Step authentication. [Ref](https://support.google.com/accounts/answer/1064203) | ||
2. Turn on "Less Secure App Access" [here](https://myaccount.google.com/intro/security) | ||
Notipyer currently supports Gmail accounts as senders. To allow the library to use your Gmail account, make the following changes: | ||
|
||
1. Turn on 2-Step authentication. [Ref](https://support.google.com/accounts/answer/185839) | ||
2. Create an app password. [Ref](https://support.google.com/mail/answer/185833) | ||
3. While creating an app password, select app as "Other (Custom name)" and enter a name of your choice. | ||
4. Use the password obtained from app password for the configuration step below. | ||
|
||
### Configuration | ||
```python | ||
from notipyer.email_notify import set_email_config | ||
|
||
SENDER_EMAIL = '[email protected]' | ||
SENDER_PASS = 'password' | ||
SENDER_PASS = 'my_app_password' | ||
set_email_config(SENDER_EMAIL, SENDER_PASS) | ||
``` | ||
### Sending Email | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.1.3' | ||
__version__ = '0.1.5' |
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
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
credentials.py |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
username = "[email protected]" | ||
password = "myapppassword" | ||
target_email = "[email protected]" |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from credentials import * | ||
from notipyer.email_notify import send_email, set_email_config | ||
|
||
set_email_config(username, password) | ||
|
||
send_email("my_subject", "my_content", [target_email]) |