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

Initial email module #2434

Merged
merged 27 commits into from
Jun 28, 2023
Merged

Conversation

pbanaszkiewicz
Copy link
Contributor

@pbanaszkiewicz pbanaszkiewicz commented Jun 8, 2023

This fixes #2433.

@pbanaszkiewicz pbanaszkiewicz added this to the v4.2 milestone Jun 8, 2023
@pbanaszkiewicz pbanaszkiewicz self-assigned this Jun 8, 2023
@pbanaszkiewicz pbanaszkiewicz force-pushed the feature/2433-email-automation-module branch 4 times, most recently from ae090da to 67a0cfe Compare June 12, 2023 21:05
@pbanaszkiewicz pbanaszkiewicz marked this pull request as ready for review June 13, 2023 20:28
@pbanaszkiewicz
Copy link
Contributor Author

@elichad I prepared this initial PR for the new email module. Please take a look. If the design doesn't make sense, let me know - I can explain.
I also marked a few places that still need tests. I will be working on them next.

This is, in my opinion, a good start for the new system. It contains 1 email action (for persons merged) and some basic views. I will be working on next steps (stories and functions we need) in upcoming days.

@pbanaszkiewicz
Copy link
Contributor Author

Small update: I was able to pretty easily fix tests related to persons merging, but there are 2 tests still failing. They relate to running a job that calculates 42 / 0 and make sure it fails. Unfortunately it looks like there was an update either to rq or fakeredis which breaks these tests. I'm going to continue investigating in the following days.

amy/emails/actions.py Outdated Show resolved Hide resolved
amy/emails/controller.py Show resolved Hide resolved
amy/emails/views.py Show resolved Hide resolved
amy/emails/views.py Show resolved Hide resolved
amy/workshops/views.py Show resolved Hide resolved
@pbanaszkiewicz
Copy link
Contributor Author

@elichad Ready for your review.

Copy link
Contributor

@elichad elichad left a comment

Choose a reason for hiding this comment

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

This looks great! Minor comments only. I wrote the summary a while after making my comments and they cover more than I remembered 😂

amy/emails/urls.py Outdated Show resolved Hide resolved
amy/templates/emails/email_template_list.html Outdated Show resolved Hide resolved
amy/templates/emails/scheduled_email_list.html Outdated Show resolved Hide resolved
amy/templates/navigation.html Outdated Show resolved Hide resolved
amy/templates/navigation.html Outdated Show resolved Hide resolved
amy/emails/models.py Show resolved Hide resolved
active=True,
id=UUID("5703079f-2f37-4aee-8267-fe6db3eee870"),
name="Person records are merged",
signal="persons_merged",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be persons_merged_signal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine for them to be different. I didn't realise that these are sort of separate things - a string that is used as a key to get the relevant EmailTemplate, and an actual Signal, which are only connected by the receiver function.

It would be a bit easier to follow if there was some sort of Signal.name attribute, that could be passed through to the email template instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately there's no such thing as Signal.name, I checked. I may add a custom field, or perhaps subclass Signal to achieve this result.

@pbanaszkiewicz
Copy link
Contributor Author

@elichad thank you for the review! I changed almost everything as you suggested. Please re-review.

@pbanaszkiewicz pbanaszkiewicz changed the title [#2433] Initial email module Initial email module Jun 24, 2023
@pbanaszkiewicz
Copy link
Contributor Author

@elichad Please take a look when you have a chance. Thanks in advance!

@pbanaszkiewicz pbanaszkiewicz force-pushed the feature/2433-email-automation-module branch from a34bfdc to 8523775 Compare June 27, 2023 19:47
@pbanaszkiewicz pbanaszkiewicz force-pushed the feature/2433-email-automation-module branch from de768db to a07f049 Compare June 28, 2023 19:41
@pbanaszkiewicz pbanaszkiewicz merged commit 048e007 into develop Jun 28, 2023
@pbanaszkiewicz pbanaszkiewicz deleted the feature/2433-email-automation-module branch August 12, 2023 09:59
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.

Add email automation module (Django app) with models
2 participants