A Python program that sends notifications to your email and phone number
-
Clone repository
$ git clone https://github.com/joiellantero/notification.git
-
Navigate to the project directory
-
Setup your environment variables in ~/.bash_profile
$ vim ~/.bash_profile
Click here if you don't have bash.
In this step you can open bash_profile using your favorite code editor by replacing
vim
withcode
(VSCode),atom
(Atom), etc. -
Add your email credentials
export EMAIL_CLIENT="youremail@email.com" export EMAIL_CLIENT_APP_PASSWORD="yourcomplexpassword"
Don't forget to setup your email to obtain your app password. Click here to learn how to obtain your app password.
-
Run the program
$ python3 notification.py
-
Star this repo if you like it!
- Using
.env
instead of~/.bash_profile
-
Create a
.env
file$ touch .env $ vim .env
-
Enter your credentials in the
.env
fileexport EMAIL_CLIENT="youremail@email.com" export EMAIL_CLIENT_APP_PASSWORD="yourcomplexpassword"
You may need to setup your email to obtain your app password. Click here to learn how to obtain your app password.
-
Install the dependency
$ pip install python-dotenv
-
Run
notification2.py
since this is set up to read the.env
$ python3 notification2.py
-
- Replace the email address passed in the function call
email_alert("this is my subject", "1234567890@txt.att.net", "this is my body")
The SMS gateway domain depends on your carrier. Visit this link to learn more.