Skip to content

Commit

Permalink
✨(domains) allow to send email to domain support
Browse files Browse the repository at this point in the history
Notify domain support configured for a MailDomain
  • Loading branch information
sdemagny committed Feb 3, 2025
1 parent 639acc1 commit af0bbda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to

### Added

- ✨(domains) allow to send email to domain support
- ✨(domains) add support email field
- ✨(domains) add action required status on MailDomain
- ✨(dimail) send pending mailboxes upon domain activation
Expand Down
6 changes: 5 additions & 1 deletion src/backend/mailbox_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from django.conf import settings
from django.core import exceptions, validators
from django.core import exceptions, mail, validators
from django.db import models
from django.utils.text import slugify
from django.utils.translation import gettext_lazy as _
Expand Down Expand Up @@ -74,6 +74,10 @@ def get_abilities(self, user):
"manage_accesses": is_owner_or_admin,
}

def email_support(self, subject, message, from_email=None, **kwargs):
"""Send an email to the support of the domain."""
mail.send_mail(subject, message, from_email, [self.support_email], **kwargs)


class MailDomainAccess(BaseModel):
"""Allow to manage users' accesses to mail domains."""
Expand Down

0 comments on commit af0bbda

Please sign in to comment.