Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template directory structure may need some work #19

Open
jproffitt opened this issue Nov 22, 2016 · 0 comments
Open

Template directory structure may need some work #19

jproffitt opened this issue Nov 22, 2016 · 0 comments

Comments

@jproffitt
Copy link
Contributor

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants