joiellantero / py-notification

A Python script that sends notifications to your email or phone number

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notification Alert Program

A Python program that sends notifications to your email and phone number

License

πŸš€ Quickstart

  1. Clone repository

    $ git clone https://github.com/joiellantero/notification.git
  2. Navigate to the project directory

  3. 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 with code (VSCode), atom (Atom), etc.

  4. 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.

  5. Run the program

    $ python3 notification.py
  6. Star this repo if you like it!

πŸ›  Alternative

  • Using .env instead of ~/.bash_profile
    1. Create a .env file

      $ touch .env
      $ vim .env
    2. Enter your credentials in the .env file

       export 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.

    3. Install the dependency

      $ pip install python-dotenv
    4. Run notification2.py since this is set up to read the .env

      $ python3 notification2.py

πŸ“± Mobile Notifications

  1. 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.

πŸ‘¨β€πŸ’» Author

πŸ“„ License

About

A Python script that sends notifications to your email or phone number

License:MIT License


Languages

Language:Python 100.0%