-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from vintasoftware/feat/update-to-3.0.1
Bump version: 3.0.0 → 3.0.1
- Loading branch information
Showing
19 changed files
with
241 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
[bumpversion] | ||
current_version = 2.3.0 | ||
current_version = 3.0.1 | ||
commit = True | ||
tag = True | ||
tag_name = {new_version} | ||
|
||
[bumpversion:file:setup.py] | ||
search = VERSION = '{current_version}' | ||
replace = VERSION = '{new_version}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,18 @@ | ||
language: python | ||
|
||
python: | ||
- "3.5" | ||
|
||
env: | ||
- TOX_ENV=py27-flake8 | ||
- TOX_ENV=py35-django110 | ||
- TOX_ENV=py34-django110 | ||
- TOX_ENV=py27-django110 | ||
- TOX_ENV=py35-django19 | ||
- TOX_ENV=py34-django19 | ||
- TOX_ENV=py27-django19 | ||
- TOX_ENV=py35-django18 | ||
- TOX_ENV=py34-django18 | ||
- TOX_ENV=py27-django18 | ||
- "3.6" | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
|
||
install: | ||
- pip install tox | ||
- pip install tox-travis | ||
- pip install -r requirements.txt | ||
- pip install coveralls | ||
|
||
script: | ||
- tox -e $TOX_ENV | ||
- tox | ||
|
||
after_script: | ||
coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,16 @@ develop branch: https://github.com/vintasoftware/django-templated-email/blob/dev | |
|
||
stable pypi/master: https://github.com/vintasoftware/django-templated-email/blob/master/README.rst | ||
|
||
|
||
Requirements | ||
================= | ||
* Python (3.6, 3.7, 3.8, 3.9) | ||
* Django (2.2, 3.1, 3.2) | ||
|
||
We **highly recommend** and only officially support the latest patch release of | ||
each Python and Django series. | ||
|
||
|
||
Getting going - installation | ||
============================== | ||
|
||
|
@@ -185,8 +195,8 @@ First get the image content from a file or a *ImageField*: | |
.. code-block:: python | ||
# From a file | ||
with open('lena.png', 'rb') as lena: | ||
image = lena.read() | ||
with open('pikachu.png', 'rb') as pikachu: | ||
image = pikachu.read() | ||
# From an ImageField | ||
# Suppose we have this model | ||
|
@@ -201,7 +211,7 @@ Then create an instance of *InlineImage*: | |
from templated_email import InlineImage | ||
inline_image = InlineImage(filename="lena.png", content=image) | ||
inline_image = InlineImage(filename="pikachu.png", content=image) | ||
Now pass the object on the context to the template when you send the email. | ||
|
@@ -210,13 +220,13 @@ Now pass the object on the context to the template when you send the email. | |
send_templated_mail(template_name='welcome', | ||
from_email='[email protected]', | ||
recipient_list=['[email protected]'], | ||
context={'lena_image': inline_image}) | ||
context={'pikachu_image': inline_image}) | ||
Finally in your template add the image on the html template block: | ||
.. code-block:: html | ||
<img src="{{ lena_image }}"> | ||
<img src="{{ pikachu_image }}"> | ||
Note: All *InlineImage* objects you add to the context will be attached to the e-mail, even if they are not used in the template. | ||
|
@@ -315,6 +325,7 @@ Methods: | |
**templated_email_get_recipients(self, form)** (mandatory): | ||
Return the recipient list to whom the email will be sent to. | ||
ie: | ||
|
||
.. code-block:: python | ||
def templated_email_get_recipients(self, form): | ||
|
@@ -324,6 +335,7 @@ Methods: | |
Use this method to add extra data to the context used for rendering the template. You should get the parent class's context from | ||
calling super. | ||
ie: | ||
|
||
.. code-block:: python | ||
def templated_email_get_context_data(self, **kwargs): | ||
|
@@ -334,6 +346,7 @@ Methods: | |
**templated_email_get_send_email_kwargs(self, valid, form)** (optional): | ||
Add or change the kwargs that will be used to send the e-mail. You should call super to get the default kwargs. | ||
ie: | ||
|
||
.. code-block:: python | ||
def templated_email_get_send_email_kwargs(valid, form): | ||
|
@@ -356,7 +369,7 @@ Using django_templated_email in 3rd party applications | |
|
||
If you would like to use django_templated_email to handle mail in a reusable application, you should note that: | ||
|
||
* Your calls to **send_templated_mail** should set a value for **template_dir**, so you can keep copies of your app-specific templates local to your app (although the loader will find your email templates if you store them in *<your app>/templates/templated_email*, if **TEMPLATED_EMAIL_TEMPLATE_DIR** has not been overidden) | ||
* Your calls to **send_templated_mail** should set a value for **template_dir**, so you can keep copies of your app-specific templates local to your app (although the loader will find your email templates if you store them in *<your app>/templates/templated_email*, if **TEMPLATED_EMAIL_TEMPLATE_DIR** has not been overridden) | ||
* If you do (and you should) set a value for **template_dir**, remember to include a trailing slash, i.e. *'my_app_email/'* | ||
* The deployed app may use a different backend which doesn't use the django templating backend, and as such make a note in your README warning developers that if they are using django_templated_email already, with a different backend, they will need to ensure their email provider can send all your templates (ideally enumerate those somewhere convenient) | ||
|
||
|
@@ -402,21 +415,25 @@ Execute the following commands:: | |
|
||
bumpversion [major,minor,patch] | ||
python setup.py publish | ||
git push origin master --tags | ||
git push origin --tags | ||
|
||
|
||
Commercial Support | ||
================== | ||
|
||
This library, as others, is used in projects of Vinta clients. We are always looking for exciting work, so if you need any commercial support, feel free to get in touch: [email protected] | ||
.. image:: https://avatars2.githubusercontent.com/u/5529080?s=80&v=4 | ||
:alt: Vinta Logo | ||
:target: https://www.vinta.com.br | ||
|
||
This project, as other `Vinta Software <https://www.vinta.com.br/>`_ open-source projects is used in products of Vinta's clients. We are always looking for exciting work, so if you need any commercial support, feel free to get in touch: [email protected] | ||
|
||
|
||
|
||
.. _Django: http://djangoproject.com | ||
.. |GitterBadge| image:: https://badges.gitter.im/vintasoftware/django-templated-email.svg | ||
.. _GitterBadge: https://gitter.im/vintasoftware/django-templated-email?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | ||
.. |TravisBadge| image:: https://travis-ci.org/vintasoftware/django-templated-email.svg?branch=develop | ||
.. _TravisBadge: https://travis-ci.org/vintasoftware/django-templated-email | ||
.. |TravisBadge| image:: https://travis-ci.com/vintasoftware/django-templated-email.svg?branch=develop | ||
.. _TravisBadge: https://travis-ci.com/vintasoftware/django-templated-email | ||
.. |CoverageBadge| image:: https://coveralls.io/repos/github/vintasoftware/django-templated-email/badge.svg?branch=develop | ||
.. _CoverageBadge: https://coveralls.io/github/vintasoftware/django-templated-email?branch=develop | ||
.. |PypiversionBadge| image:: https://img.shields.io/pypi/v/django-templated-email.svg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from django.conf.urls import url | ||
from django.urls import re_path | ||
|
||
from templated_email.views import ShowEmailView | ||
|
||
app_name = 'templated_email' | ||
urlpatterns = [ | ||
url(r'^email/(?P<uuid>([a-f\d]{32})|([a-f\d]{8}(-[a-f\d]{4}){3}-[a-f\d]{12}))/$', ShowEmailView.as_view(), name='show_email'), | ||
re_path(r'^email/(?P<uuid>([a-f\d]{32})|([a-f\d]{8}(-[a-f\d]{4}){3}-[a-f\d]{12}))/$', ShowEmailView.as_view(), name='show_email'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.