This is a follow up on #265
Here is what I am thinking:
- adding more variable to the
TemplatesCustomization class like this:
def __init__(self, *args, **kwargs):
for email_template, extension in self.files:
self.__class__.variables[f"{email_template}_subject"] = ""
self.__class__.variables[f"{email_template}_send_from"] = ""
self.__class__.variables[f"{email_template}_cc_addresses"] = ""
super().__init__(*args, **kwargs)
- the
subject would be a django template string, allowing things like {{ variable }} following the same provided vars as the ones in the email template
- the
send_from would have a datalist html widget with a few predefined choices (user_office, abuse, creator, server_email, etc) and allow custom entry.
- the
cc_addresses would allow multiple entries
- for
#3 and #4 we could also simply use variable resolution to allow {{ user_office_email }} for example.
- for all the default values, I think the only way here would be to create a data migration that would add all the current
send_from and subject and cc_addresses
- this would be available in the "file & email templates" page
- we would need a way to differentiate emails from other files/fragments (maybe using the extension
email instead of html and having code to change it to html when loading the actual media file.
This is a follow up on #265
Here is what I am thinking:
TemplatesCustomizationclass like this:subjectwould be a django template string, allowing things like{{ variable }}following the same provided vars as the ones in the email templatesend_fromwould have a datalist html widget with a few predefined choices (user_office, abuse, creator, server_email, etc) and allow custom entry.cc_addresseswould allow multiple entries#3and#4we could also simply use variable resolution to allow{{ user_office_email }}for example.send_fromandsubjectandcc_addressesemailinstead ofhtmland having code to change it tohtmlwhen loading the actual media file.