From 0186f41876ec2b07c816bc5a9d4bfc8520dfcb5c Mon Sep 17 00:00:00 2001 From: SKairinos Date: Fri, 14 Jun 2024 14:05:24 +0000 Subject: [PATCH] add personalization_values kwarg --- codeforlife/user/models/user.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/codeforlife/user/models/user.py b/codeforlife/user/models/user.py index 9856e68a..cf4a6698 100644 --- a/codeforlife/user/models/user.py +++ b/codeforlife/user/models/user.py @@ -186,9 +186,18 @@ def remove_contact_from_dot_digital(self): mail.remove_contact(self.email) # pylint: disable-next=arguments-differ - def email_user(self, campaign_id: int, **kwargs): # type: ignore[override] + def email_user( # type: ignore[override] + self, + campaign_id: int, + personalization_values: t.Optional[t.Dict[str, str]] = None, + **kwargs, + ): kwargs["to_addresses"] = [self.email] - mail.send_mail(campaign_id=campaign_id, **kwargs) + mail.send_mail( + campaign_id=campaign_id, + personalization_values=personalization_values, + **kwargs, + ) # pylint: disable-next=missing-class-docstring,too-few-public-methods