mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 18:09:25 +02:00
check for org on email
This commit is contained in:
parent
5cb3298afd
commit
bde6c5e835
2 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,7 @@ from django.conf import settings
|
|||
from django.db import models
|
||||
from django_fsm import FSMField, transition # type: ignore
|
||||
from django.utils import timezone
|
||||
from waffle import flag_is_active
|
||||
from registrar.models.domain import Domain
|
||||
from registrar.models.federal_agency import FederalAgency
|
||||
from registrar.models.utility.generic_helper import CreateOrUpdateOrganizationTypeHelper
|
||||
|
@ -13,6 +14,8 @@ from registrar.utility.errors import FSMDomainRequestError, FSMErrorCodes
|
|||
from registrar.utility.constants import BranchChoices
|
||||
from auditlog.models import LogEntry
|
||||
|
||||
from registrar.utility.waffle import flag_is_active_for_user
|
||||
|
||||
from .utility.time_stamped_model import TimeStampedModel
|
||||
from ..utility.email import send_templated_email, EmailSendingError
|
||||
from itertools import chain
|
||||
|
@ -841,10 +844,13 @@ class DomainRequest(TimeStampedModel):
|
|||
|
||||
try:
|
||||
if not context:
|
||||
has_organization_feature_flag = flag_is_active_for_user(recipient, "organization_feature")
|
||||
is_org_user = has_organization_feature_flag and recipient.has_base_portfolio_permission(self.portfolio)
|
||||
context = {
|
||||
"domain_request": self,
|
||||
# This is the user that we refer to in the email
|
||||
"recipient": recipient,
|
||||
"is_org_user": is_org_user,
|
||||
}
|
||||
|
||||
if custom_email_content:
|
||||
|
|
|
@ -30,7 +30,7 @@ THANK YOU
|
|||
.Gov helps the public identify official, trusted information. Thank you for requesting a .gov domain.
|
||||
|
||||
----------------------------------------------------------------
|
||||
{% if portfolio %}
|
||||
{% if is_org_user %}
|
||||
{% include 'emails/includes/portfolio_domain_request_summary.txt' %}
|
||||
{% else %}
|
||||
{% include 'emails/includes/domain_request_summary.txt' %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue