Skip to content

Send email notifications for campaign milestones ONLY once #538

@slavcho

Description

@slavcho

Which area(s) of Podkrepi.bg are affected? (leave empty if unsure)

No response

Describe the Bug

Currently if too many donations come very fast, due to the lack of safe synchronization, we will send multiple email notifications.
We rely on the database to check if such a notification was already sent.

We don't have that many donations at the moment, but still.
This can become potentially a problem in the light of the automated b2b donations.
There we can expect that many small donations will arrive very often.

My best guess here is that we need to use the PostgreSQL transactions for that. And raise an event only if it was the current donation that moved the needle above the threshold.

To Reproduce

I assume we can reproduce this even with a unit test.

Expected Behavior

Should send only 1 notification when the raised amount goes above the thresholds (of 50%, 90%, or 100%)

Which browser are you using? (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions