dev: email notifications (#3421)
* dev: create email notification preference model * dev: intiate models * dev: user notification preferences * dev: create notification logs for the user. * dev: email notification stacking and sending logic * feat: email notification preference settings page. * dev: delete subscribers * dev: issue update ui implementation in email notification * chore: integrate email notification endpoint. * chore: remove toggle switch. * chore: added labels part * fix: refactored base design with tables * dev: email notification templates * dev: template updates * dev: update models * dev: update template for labels and new migrations * fix: profile settings preference sidebar. * dev: update preference endpoints * dev: update the schedule to 5 minutes * dev: update template with priority data * dev: update templates * chore: enable `issue subscribe` button for all users. * chore: notification handling for external api * dev: update origin request --------- Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com> Co-authored-by: LAKHAN BAHETI <lakhanbaheti9@gmail.com> Co-authored-by: Ramesh Kumar Chandra <rameshkumar2299@gmail.com> Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
This commit is contained in:
parent
c1e1b81b99
commit
f27efb80e1
35 changed files with 2482 additions and 314 deletions
28
apiserver/plane/db/migrations/0057_auto_20240122_0901.py
Normal file
28
apiserver/plane/db/migrations/0057_auto_20240122_0901.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Generated by Django 4.2.7 on 2024-01-22 09:01
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
def create_notification_preferences(apps, schema_editor):
|
||||
UserNotificationPreference = apps.get_model("db", "UserNotificationPreference")
|
||||
User = apps.get_model("db", "User")
|
||||
|
||||
bulk_notification_preferences = []
|
||||
for user_id in User.objects.filter(is_bot=False).values_list("id", flat=True):
|
||||
bulk_notification_preferences.append(
|
||||
UserNotificationPreference(
|
||||
user_id=user_id,
|
||||
created_by_id=user_id,
|
||||
)
|
||||
)
|
||||
UserNotificationPreference.objects.bulk_create(
|
||||
bulk_notification_preferences, batch_size=1000, ignore_conflicts=True
|
||||
)
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("db", "0056_usernotificationpreference_emailnotificationlog"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(create_notification_preferences)
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue