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

[Feature] Sending receipts and balance notifications #144

Open
2 tasks
rinkp opened this issue Jan 20, 2024 · 7 comments
Open
2 tasks

[Feature] Sending receipts and balance notifications #144

rinkp opened this issue Jan 20, 2024 · 7 comments

Comments

@rinkp
Copy link
Member

rinkp commented Jan 20, 2024

Perhaps we may want to consider: sending receipts / notifications

Currently people discover their balance is negative when they receive a notification that they will be fined, not when they actually did a transaction. While this works for users that maintain a close-to-negative balance, this does not work for all users.

My proposal is to:

  • Allow users to enable transaction notifications including a summary of bought items for all transactions, i.e. like a receipt
  • Allow users to enable balance notifications each first transaction of the day while their balance is <€0
@CodeNamedRobin
Copy link
Contributor

People do get notifications exactly when they go in debt, however this might still be a nice idea to implement.

@JustSamuel
Copy link
Contributor

Clarification:

Do you propose that the user receives a "transaction" overview as a receipt?
Don't people already get balance notifications when dropping down to <0?

@rinkp
Copy link
Member Author

rinkp commented Jan 22, 2024

Do you propose that the user receives a "transaction" overview as a receipt?

Yes, if they enable this. This allows users to immediately notice something has been charged to their account while they were not aware of it. I propose a 3-state selector.

Do you want to receive notifications for transactions:

  • Never
  • When someone else charges my account (including social drinks)
  • For all transactions

Don't people already get balance notifications when dropping down to <0?

@CodeNamedRobin told me they do, but the point is that you will only find out your account has been erroneously charged once you have a debt which I think is not nice.

@rinkp
Copy link
Member Author

rinkp commented Jan 22, 2024

@JustSamuel, the example you asked for

example email

# GEWIS Newsletter
---
# All mailings require some settings. These can be set here. Don't forget to set the title ("Algemene mededeling; tekst zelf invoeren")
version: 1.1
settings:
    title: "Your SudoSOS transaction on January 1st"
    email: "sudosos@removed-for-spam-reasons"
    #unsubscribe: https://lists.gewis.nl/postorius/lists/gewis.lists.gewis.nl/
    lang: en-UK
    #lang: nl-NL
    #url: "https://secr.personal.gewis.nl/newsletter/2022/newsletter-8.html"
    follow: false


# A mailing consists of a series of messageblocks, each with their own type
# The available types are "header", "topblock", "activities", "activityfooter", "extramessage" and "tinyfooter"
messageblocks:

# Each mailing must have a header to make the template shine! It contains the title and the date.
    - type: "header"
      title: "SudoSOS update"
      date: 2024-01-01

# This is the first block which is shown on top of the message. Recommended for most messages
    - type: topblock
      title: "Transaction notification"
      contentHTML: >
        <p>Dear {{FIRSTNAME}},<br/><br/>
          We love to inform you that {{you just made a purchase|a purchase was entered on behalf}} in SudoSOS. Below are the details:
        </p>
        <table style='width:100%;'>
          <tr><th style='width:20%;'>Quantity</th><th style='width:60%;'>Product</th><th style='width:20%;'>Price</th></tr>
          <tr><td>1</td><td>Kitkat (€0,60)</td><td>€0,60</td></tr>
          <tr><td>12</td><td>Grolsch Premium Pilsener (€1,00)</td><td>€12,00</td></tr>
        </table>
        <p>We have debited your account for the total amount <strong>€12,34</strong> which leaves you with a total {{balance|debt}} of €432,10.</p>
        <p>{{if negative: Please note that late fees are charged each Thursday after the social drink.}}
        You can increase your balance at any time on <a href="https://sudosos.gewis.nl">https://sudosos.gewis.nl</a>.</p>
        <p>If you have any questions about this transaction, please reach out to the email address in the footer of this email.

# You probably want to include this each newsletter
    - type: tinyfooter
      contentHTML: >
        You are receiving this email because you are registered as a SudoSOS user and have opted in to receiving notifications for transactions. Learn more about how we treat your personal data on <a href="https://gew.is/privacy">https://gew.is/privacy</a>.

@JustSamuel
Copy link
Contributor

Picking this up in the following branch: https://github.com/GEWIS/sudosos-backend/tree/feature/notifications

However, this will most likely be superseded by implementing the DB sync once I have the API key.

@JustSamuel
Copy link
Contributor

also @rinkp any chance there could be an easy to generate emails in that template? might be a nice feature to move most of our e-mailing over to that system to keep it GEWIS consistent

@rinkp
Copy link
Member Author

rinkp commented Jan 30, 2024

There is for php in GEWIS/GEWISDB?
The YAML to HTML generator is pure JS, so maybe you can include that.

I would suggest to not make an external dependency like for pdfs where the service could be unavailable since you don't want email messages to become unavailable at any point in time.

@JustSamuel JustSamuel changed the title Sending receipts and balance notifications [Feature] Sending receipts and balance notifications Sep 29, 2024
@SvenMokveldje SvenMokveldje self-assigned this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

5 participants