Skip to content

Commit

Permalink
Update version to 0.2.1
Browse files Browse the repository at this point in the history
- Changed README format to reStructuredText, for rendering on PyPi
- Added CHANGELOG
  • Loading branch information
Kevin Renskers committed Dec 1, 2011
1 parent a1aa1d6 commit fc4cd2a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 13 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
@@ -0,0 +1,10 @@
0.1: never released
- First initial version

0.2: December 1, 2011
- First public release on PyPi
- Added correct package dependencies

0.2.1: December 1, 2011
- Changed README format to reStructuredText, for rendering on PyPi
- Added CHANGELOG
42 changes: 31 additions & 11 deletions README.md → README.rst
@@ -1,26 +1,45 @@
# Django generic (class based) mail ========
Overview
========


Easy to use, class based email for Django. **Easy to use, class based email for Django.**


## The problem The problem
There is no unified way in our Django projects to send email. Django's own email functions require too much boilerplate code and are not intelligent enough. They are also not class based. ===========
There is no unified way in our Django projects to send email. Django's own email functions require too much boilerplate
code and are not intelligent enough. They are also not class based.


Sending email should be as easy as creating an instance of the email class, provide one piece of text, and calling the send() method. This is the easiest, most common case. It should also be possible to override base templates, give separate text- and html versions, send the mail to a queue, etc. Sending email should be as easy as creating an instance of the email class, provide one piece of text, and calling the
send() method. This is the easiest, most common case. It should also be possible to override base templates,
give separate text- and html versions, send the mail to a queue, etc.


## What this class will do for you What this class will do for you
===============================
- It will send text email if: - It will send text email if:

1. there is a custom text template, or 1. there is a custom text template, or

2. when using default templates, if text_body is set 2. when using default templates, if text_body is set

- It will send html email if: - It will send html email if:

1. there is a custom html template, or 1. there is a custom html template, or

2. when using default templates, if html_body is set 2. when using default templates, if html_body is set

- You can also force to send a text email when there is only a html_body. It will then convert html to text for you. - You can also force to send a text email when there is only a html_body. It will then convert html to text for you.

- You can also force to send a html email when there is only a text_body. It will then convert text to html for you. - You can also force to send a html email when there is only a text_body. It will then convert text to html for you.


## What it doesn't do What it doesn't do
This email class doesn't know about mail queues. You can use a custom email backend or a project like [Django-mailer](https://github.com/jtauber/django-mailer) for that. ==================
This email class doesn't know about mail queues. You can use a custom email backend or a project like
https://github.com/jtauber/django-mailer for that.

Usage
=====
::


## Usage
from generic_mail import Email from generic_mail import Email


# This will send text email only, uses the email/base_text_email.html template with the "body" template variable # This will send text email only, uses the email/base_text_email.html template with the "body" template variable
Expand Down Expand Up @@ -63,6 +82,7 @@ This email class doesn't know about mail queues. You can use a custom email back
email = Email('to@example.com', 'Subject') email = Email('to@example.com', 'Subject')
email.send() email.send()


## Subclassing Subclassing
===========
If you want to create your own subclass that has different defaults (other templates, subject, etc), the best way to do If you want to create your own subclass that has different defaults (other templates, subject, etc), the best way to do
this is by changing the class properties instead of overriding the `__init__` method. this is by changing the class properties instead of overriding the ``__init__`` method.
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -2,9 +2,9 @@


setup( setup(
name="django-generic-mail", name="django-generic-mail",
version='0.2', version='0.2.1',
description="Easy to use, class based email for Django", description="Easy to use, class based email for Django",
long_description=open("README.md").read(), long_description=open("README.rst").read(),
author="Kevin Renskers", author="Kevin Renskers",
author_email="info@mixedcase.nl", author_email="info@mixedcase.nl",
url="https://github.com/kevinrenskers/django-generic-mail", url="https://github.com/kevinrenskers/django-generic-mail",
Expand Down

0 comments on commit fc4cd2a

Please sign in to comment.