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

added EmailTemplate.label attribute #320

Closed
wants to merge 1 commit into from

Conversation

madEng84
Copy link

@madEng84 madEng84 commented Jul 3, 2020

added EmailTemplate.label attribute to display an optional human readable name of an EmailTemplate

Enabling this feature, end users will more easily understand which EmailTemplate to use

@jrief
Copy link
Collaborator

jrief commented Jul 3, 2020

why aren't the name and the description fields not enough in your use-case?

@madEng84
Copy link
Author

madEng84 commented Jul 5, 2020

The 'name' is machine-readable and it should be not editable after creation to avoid bugs in your code. I'm afraid that end user wants to change it to set it more human readable without a "don't touch me" help_text
The 'description' is not concise, it explains with more words the boundary conditions, it explains why but expecially when your code uses it.
An alternative to add a 'label' could be this one: set a forms.select as the widget of the name attribute showing the end user only the human readable names.
We can think to set a setting EMAIL_TEMPLATE_NAME_CHOICES, documenting it properly, to avoid end users to change it and dev users to misspell it.

What do you think about?

@madEng84 madEng84 marked this pull request as draft July 6, 2020 07:54
@jrief
Copy link
Collaborator

jrief commented Jul 9, 2020

I don't see any benefit from this, except adding another moving part to the project and thus another potential source of error.
Apart from that, if we add a label-field, then that field shall be editable on the translated templates as well – don't you think so?

Maybe I'm a bit naive here. Could you please give me a concrete example to which values you would set name, label and description.

@jrief
Copy link
Collaborator

jrief commented Jul 22, 2020

OK, I see your point. So, you need a kind of identifier, so that you can find and access an EmailTemplate from your Python code. This would be a valid use-case.

How about leaving the name-field as a human readable label and instead adding an optional identifier which is language independent?

@jrief
Copy link
Collaborator

jrief commented Jul 23, 2020

@madEng84 please have a look at pull request #324. There you can use a language independent identifier field to access the template. There the name field remains human readable.

@madEng84 madEng84 closed this Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants