biwis/te-send-email

By biwis

Updated about 3 years ago

wkhtmltopdf, html to pdf, sending email, sending a file by email, email report

Image
Message queues
0

403

biwis/te-send-email repository overview

te-send-email

te-send-email is a lightweight program for sending files via email. It is also an html to pdf converter. It can send any file by attaching it as a binary attachment. In the container, the script searches for files with the given extension in the variable format. For the container to work, you need to mount the config and shared folders. The config folder should contain an email.conf file with settings for sending emails. In the shared/reports folder, there should be a file to send with the desired extension. Only one file will be attached to the letter.

Getting Started

  1. Pull this image:
docker pull biwis/te-send-email
  1. Run docker container.
  • Example of sending html to email:
docker run --rm --name te-send-email -v "$PWD/shared:/shared:Z" -v "$PWD/config:/config:Z" -e format="html"  biwis/te-send-email
  • An example of converting html to pdf and sending pdf to email:
docker run --rm  --name te-send-email -v "$PWD/shared:/shared:Z" -v "$PWD/config:/config:Z" -e format="pdf" -e convert="yes"  biwis/te-send-email 
  • Example of sending pdf to email:
docker run --rm  --name te-send-email -v "$PWD/shared:/shared:Z" -v "$PWD/config:/config:Z" -e format="pdf"  biwis/te-send-email
  • An example of converting html to pdf without sending it to the email:
docker run --rm  --name te-send-email -v "$PWD/shared:/shared:Z" -v "$PWD/config:/config:Z" -e format="pdf" -e convert="yes" -e email="no" biwis/te-send-email
  • Example of running a task in a container on a schedule (cron statement)
docker run -d  --name te-send-email -v "etc/timezone:/etc/timezone:ro" -v "/etc/localtime:/etc/localtime:ro" -v "$PWD/shared:/shared:Z" -v "$PWD/config:/config:Z" -e format="pdf" -e convert="yes" -e cron_time="0 5 * * 1" biwis/te-send-email
  • Example docker compose file
version: "3.9"
services:
  te-send-email:
    image: "biwis/te-send-email:latest"
    volumes:
      - "./config:/config:Z"
      - "./shared:/shared:Z"
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      cron_time: "00 5 20 * *"
      convert: "yes"
      format: "pdf"
    restart: on-failure

Default value

These values are in run.sh and sheduler.py of this image

format="pdf" # attached file extension
convert="no" # converting html to pdf file
email="yes"  # sending an email message
cron_time="" # crond scheduling an email message to be sent
command="/run.sh" #run command in this container
arg="" #argument for the command in this container

Example configuration file for sending email

[SMTP]
server=>email server addres>
port=<port>
email_from=<name>
email_to=<name>
password=<password>
subject="Test subject"
message="Test message."

valid variable "port" values for security connection:

  • 465 - SSL connection
  • 587 - TLS (STARTTLS) connection

Tag summary

Content type

Image

Digest

sha256:ba417a9e0

Size

143.7 MB

Last updated

about 3 years ago

docker pull biwis/te-send-email:bullseye