Metadata-Version: 2.1
Name: django-html-emailtemplates
Version: 0.0.1
Summary: A simple Django app to create and send editable emails.
Home-page: https://www.rhysgibbs.co.uk/
Author: Rhys Gibbs
Author-email: development@rhysgibbs.co.uk
License: BSD License
Description: # Django HTML Email Templates
        
        A Django app for allowing users to create html emails using Django template variables
        passed in to the context.
        
        
        ## Installation
        
        Use the package manager [pip](https://pip.pypa.io/en/stable/) to install django-html-email-templates.
        
            pip install django-html-email-templates
        
        
        ## Usage
        
            # models.py
            class Settings(models.Model):
                contact_form_reply = models.ForeignKey(
                    'emailtemplates.EmailTemplate'
                )
        
            # views.py
            from emailtemplates.utils import send_email_template
            from emailtemplates.models import EmailTemplate
            from .models import Settings
        
            # view definition
            def form_valid(self, form):
                enquiry = form.save()
                # send reply email to website user
                send_email_template(
                    Settings.objects.first().contact_form_reply,
                    [enquiry.email],
                    {
                        'name': enquiry.name,
                        'subject_matter': enquiry.subject,
                    }
                )
                # send notification to website owner
                send_email_template(
                    EmailTemplate(
                        subject='Enquiry from example.com',
                        content='''<div>
                            <p>There was an enquiry on your website, the details are below:</p>
                            <table>
                                <tbody>
                                    <tr>
                                        <td>Name:</td>
                                        <td>{{ enquiry.name }}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>'''
                    ),
                    ['contact@example.com'],
                    {
                        'enquiry': enquiry
                    }
                )
        
        
        ## Features to add
        - [ ] Add custom ForeignKey field to display the context that can be used
        - [ ] Add plugins for images/documents
        - [ ] Add better html field
        - [ ] Add support for Wagtail StreamField
        
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 2.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Description-Content-Type: text/markdown
