X-Git-Url: https://git.mdrn.pl/cas.git/blobdiff_plain/5c901ee485c3abdf11dec71bdb7534f1f6a9eaa9..e3abdd10e98cab59f1b97c71d6e2317e00149973:/src/accounts/models.py diff --git a/src/accounts/models.py b/src/accounts/models.py index b0be8d4..0197eba 100644 --- a/src/accounts/models.py +++ b/src/accounts/models.py @@ -1,6 +1,20 @@ +from django.db import models +from django.utils.translation import gettext_lazy as _ from cas_provider.signals import cas_collect_custom_attributes +class OnboardingEmail(models.Model): + subject = models.CharField(_("subject"), max_length=255) + body = models.TextField( + _("body"), + help_text=_("Available placeholders: {username}, {password}, {first_name}, {last_name}") + ) + + class Meta: + verbose_name = _("onboarding email template") + verbose_name_plural = _("onboarding email templates") + + def user_attributes(sender, user, **kwargs): return { 'firstname': user.first_name,