Skip to content

Commit

Permalink
email user helper
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jun 14, 2024
1 parent 842bcf1 commit ef3bc0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion codeforlife/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def add_contact(
if auth is None:
auth = os.environ["DOTDIGITAL_AUTH"]

contact: JsonDict = {"email": email}
contact: JsonDict = {"email": email.lower()}
if opt_in_type is not None:
contact["optInType"] = opt_in_type
if email_type is not None:
Expand Down
7 changes: 4 additions & 3 deletions codeforlife/user/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ def remove_contact_from_dot_digital(self):
"""Remove contact info from DotDigital."""
mail.remove_contact(self.email)

# TODO: override when ready to use DotDigital as our sole email provider.
# def email_user(self):
# mail.send_mail()
# pylint: disable-next=arguments-differ
def email_user(self, campaign_id: int, **kwargs): # type: ignore[override]
kwargs["to_addresses"] = [self.email]
mail.send_mail(campaign_id=campaign_id, **kwargs)


# pylint: disable-next=missing-class-docstring,too-few-public-methods
Expand Down

0 comments on commit ef3bc0c

Please sign in to comment.