Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add days left data binding to inactivity reminders #365

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

faucomte97
Copy link
Contributor

@faucomte97 faucomte97 commented Sep 26, 2024

This change is Reviewable

@faucomte97 faucomte97 self-assigned this Sep 26, 2024
Copy link
Contributor

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 4 unresolved discussions (waiting on @faucomte97)


src/api/views/user.py line 376 at r1 (raw file):

        days: int,
        campaign_name: str,
        personalization_values: t.Optional[dict] = None,

replace with
days_left: t.Optional[int] = None


src/api/views/user.py line 403 at r1 (raw file):

                            ],
                            to_addresses=[email],
                        )

don't repeat send send_mail

send_mail(
                            campaign_id=settings.DOTDIGITAL_CAMPAIGN_IDS[
                                campaign_name
                            ],
                            to_addresses=[email],
personalization_values={"DAYS_LEFT": days_left} if days_left else None
                        )

Code quote:

                    if personalization_values is not None:
                        send_mail(
                            campaign_id=settings.DOTDIGITAL_CAMPAIGN_IDS[
                                campaign_name
                            ],
                            to_addresses=[email],
                            personalization_values=personalization_values,
                        )
                    else:
                        send_mail(
                            campaign_id=settings.DOTDIGITAL_CAMPAIGN_IDS[
                                campaign_name
                            ],
                            to_addresses=[email],
                        )

src/api/views/user_test.py line 758 at r1 (raw file):

            days: int,
            mail_sent: bool,
            personalization_values: t.Optional[dict] = None,

see above comment about changing arg


src/api/views/user_test.py line 777 at r1 (raw file):

                if mail_sent:
                    if personalization_values is not None:

see above comment about not repeating code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants