worthwhile/django-herald

Template directory structure may need some work

jproffitt opened this issue · 0 comments

Right now, you are forced to make sure your templates are in the following directory structure: herald/html/{notifcation_name}.html or herald/text/{notifcation_name}.txt.

First of all, that should definitely be overridable. Maybe rename NotificationBase.template_name to NotificationBase.template_base_name to avoid confusion, then add the ability to define absolute template paths per render_type. (but the current default would still remain). like the following:

class MyEmail(NotificationBase):
    template_names = {
        'text': 'my/custom/template/path.txt',
        'html': 'my/custom/template/path.html'
    }

Secondly, is the current default even a good default? Rather than herald/html/{notifcation_name}.html or herald/text/{notifcation_name}.txt should it maybe be {app name}/{notifcation_name}.html or {app name}/{notifcation_name}.txt similar to how the django generic class based views find templates by default (for example, {app_name}/{model_name}_create.html is the default for CreateViews.)