-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
Description
This is a follow up on #265
Here is what I am thinking:
- adding more variable to the
TemplatesCustomizationclass 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
subjectwould be a django template string, allowing things like{{ variable }}following the same provided vars as the ones in the email template - the
send_fromwould have a datalist html widget with a few predefined choices (user_office, abuse, creator, server_email, etc) and allow custom entry. - the
cc_addresseswould allow multiple entries - for
#3and#4we 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_fromandsubjectandcc_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
emailinstead ofhtmland having code to change it tohtmlwhen loading the actual media file.