Skip to main content

django-mails

django-mails is Django App to send simple or HTML template Emails by calling just hit of single function.

Quick Start

  1. Add 'email_service' to your INSTALLED_APPS setting like this::
    INSTALLED_APPS = [
        ...
        'email_service',
        'ckeditor',
    ]
    
  2. Run python manage.py migrate to create the django-mails models.
  3. Set Email Settings in setting.py file
    EMAIL_FROM = ""
    EMAIL_BCC = ""
    EMAIL_HOST = ""
    EMAIL_PORT = ""
    EMAIL_HOST_USER = ""
    EMAIL_HOST_PASSWORD = ""
    EMAIL_USE_TLS = True
    EMAIL_USE_SSL = False
    
  4. Add Templates path to your TEMPLATES in setting.py
  5. import method to send email from email_service.utils import send_custom_email
  6. set LOGO_IMAGE_NAME variable in setting.py file to add logo in email (Name should include subfolder inside static folder)
  7. To send html email : Create html and txt files for email content and subject respectively. Name of both file should be same and txt file name should contain "_subject" as suffix.
  • for example : welcome_email.html and welcome_email_subject.txt

Description

send_custom_email(
    recipient: List[str] | str,
    path: str | None = None,
    template: any = None,
    template_prefix: str | None = None,
    context: Dict = {},
    subject: str | None = None,
    body: str | None = None,
    attachment: any = None,
    parts:list[dict] = None,
    enable_logo : bool = False
)
  • recipient : List of Receivers emails
  • path : path to html file for email content and subject (path should be upto parent folder of html file inside template folder)
  • template : Object of Template Model if exists (Optional)
  • template_prefix : html file name
  • context : context to replace variable name in template
  • subject : subject of email as string
  • body : content of email as string
  • attachment: attach file to send email as attachement
  • parts (list[dict]): list of dictionaries with part name and data
  • enable_logo : set true to enable logo in email

Setup guideline

  • build: Create the build and runtime images
    docker-compose build
  • up: Start up the project
    docker-compose up
  • To see services and their ports
    docker ps
  • shell: Shell into the running Django container
    docker exec -it CONTAINER ID /bin/bash
  • migrate: Changes you have made to your models
   python manage.py makemigrations
   python manage.py migrate
   python manage.py createsuperuser

Metadata

Release files for django-mails 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-mails 1.1.0
File Size Uploaded
django_mails-1.1.0.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-mails 1.1.0
File Interpreter ABI Platform
django_mails-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / django_mails-1.1.0.tar.gz

Download URL django_mails-1.1.0.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
634a64734d708620e79605115a265ceff7fb779236019449c52f938419dfdddc
BLAKE2b-256 checksum
How to use checksums
b541d6a442b86a1ba4b3838ee5170c30e8cd219726e4e056c05241554e6d9ec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / django_mails-1.1.0-py3-none-any.whl

Download URL django_mails-1.1.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0089459f2542916347065bdc007cc9fe6181ca4e07d2363d4e41ffc6bc58f548
BLAKE2b-256 checksum
How to use checksums
956985512d85c927eaeba8d6c2e05b374c4b183bc34d6b80b9f7a8cd31b35a78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page