fsr-de / myHPI

Django/Wagtail page serving myhpi.de
https://myhpi.de
11 stars 11 forks source link

Add button to leave mailing list in dashboard #584

Open jeriox opened 1 month ago

jeriox commented 1 month ago

In the list dashboard, a user can click on the name of a list that they are a member of, which takes them to the (un)subscribe view with their mail address prefilled. This is a bit confusing as a unsubscribe flow. As a user, I want the box of a mailing list to have a "unsubscribe" button that unsubscribes me directly.

lukasrad02 commented 1 month ago

Since our students have two email addresses (short and long form) and the dashboard lists subscriptions for both variants, clicking the unsubscribe button should also cancel subscriptions for both variants if they are present.

Otherwise, there might still be an active subscription after clicking the button.

SilvanVerhoeven commented 1 month ago

Could you clarify: Are users still allowed to subscribe/unsubscribe with custom email addresses? If so, how would the system know which email address(es) the unsubscribe button should relate to?

lukasrad02 commented 1 month ago

The button proposed here should only be visible on the lists dashboard, which is, in turn, only accessible for logged-in users. Hence, we could derive the email address(es) from the account information.

If people (no matter whether they have an HPI account or not) subscribe non-HPI addresses to a mailing list, we cannot associate that subscription with an account. In this case, they would still have to use the unsubscribe link and enter their email address manually.

jeriox commented 1 month ago

Could you clarify: Are users still allowed to subscribe/unsubscribe with custom email addresses? If so, how would the system know which email address(es) the unsubscribe button should relate to?

They are. But the list dashboard only contains mailing lists that you are a member of with your HPI address. So clicking the button would unsubscribe your HPI address.

Toggling the membership via the distribution link will not be affected by this.

SilvanVerhoeven commented 1 month ago

Does myHPI have access to all my email addresses (@student.hpi.de and @student.hpi.uni-potsdam.de) to iterate over them or does this need to be hard coded?

lukasrad02 commented 1 month ago

This is already hardcoded (https://github.com/fsr-de/myHPI/blob/main/myhpi/settings.py#L307C1-L310C2), the HPI IdP only exposes the primary email address