/python-emailer

Get a dog picture in your email every hour.

Primary LanguagePython

python-emailer

Email every hour

A small script to send dog pictures to myself every hour via email.

E-Mail Sample

dog sample email

How to get a dog in your e-mail

Raise an issue with your email-id and the frequency with which you want to receive cute dog pics and I'll add you to the mailing list.

Automated with Github Actions

The email.yml file builds a python 3.8 environment and runs the emailer.py script to send out dog pictures every hour.

API Used

Dog pictures are fetched from the following API.

The dog API

Github Repo for dog API

Planned Improvements

  • Open up email list to public
  • Create workflow to add email from pull request to email list.

Contributing

If you can help with any of the tasks in the Planned Improvements section (they are also open issues) feel free to make a pull request with your code.

Set up

Google Set up

  1. Go to the following link to set up an app password for your google account.

    Link

  2. Set email address and password generated for third-party app as environment variables.

    $ export EMAIL_USER=<Your email id>
    $ export EMAIL_PASSWORD=<Generated password>
    

You may have to set up 2FA if you have not already (Two factor authentication is highly recommended. Not everyone on the Internet wants to send you dog pictures every hour, some people want your bank details).

Repository Set up

  1. Clone the repository

    $ git clone https://github.com/tintindas/python-emailer.git

  2. Navigate into directory

    $ cd python-emailer

  3. Set up Python virtual environment

    $ python3 -m venv .venv

    .venv is what I usually name my virtual environment folder.

  4. Activate environment

    $ source .venv/bin/activate

  5. Install dependencies

    $ pip install -r requirements.txt

  6. Edit email list

    Edit the line below. Reset the array with your email addresses.

    msg['To'] = ['upamanyudas16@gmail.com', to_email]

  7. Run script

    $ python emailer.py