File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export type Account = Models.User<
99 organization ?: string ;
1010 console : Models . Preferences ;
1111 notificationPrefs : Record < string , NotificationPrefItem > ;
12+ deploymentFailedEmailAlert : boolean ;
1213 } & Record < string , string >
1314> ;
1415
Original file line number Diff line number Diff line change 1+ <script >
2+ import { CardGrid } from " $lib/components" ;
3+ import { InputChoice } from " $lib/elements/forms" ;
4+ import { Container } from " $lib/layout" ;
5+ import { sdk } from ' $lib/stores/sdk' ;
6+ import { user } from ' $lib/stores/user' ;
7+ import { Layout } from " @appwrite.io/pink-svelte" ;
8+
9+ let deploymentFailedEmailAlert = $user .prefs .deploymentFailedEmailAlert ?? true ;
10+
11+ function toggleDeploymentFailedEmailAlert () {
12+ deploymentFailedEmailAlert = ! deploymentFailedEmailAlert;
13+ const newPrefs = {
14+ ... $user .prefs ,
15+ deploymentFailedEmailAlert: deploymentFailedEmailAlert
16+ };
17+ sdk .forConsole .account .updatePrefs ({ prefs: newPrefs });
18+ }
19+
20+ < / script>
21+
22+ < Container>
23+ < CardGrid>
24+ < svelte: fragment slot= " title" > Email Alerts< / svelte: fragment>
25+ Toggle email preferences to receive notifications when certain events occur.
26+
27+ < svelte: fragment slot= " aside" >
28+ < Layout .Stack gap= " xl" >
29+ < InputChoice
30+ on: change= {toggleDeploymentFailedEmailAlert}
31+ type= " switchbox"
32+ id= " mfa"
33+ label= " Deployment Failed"
34+ value= {deploymentFailedEmailAlert} / >
35+ < / Layout .Stack >
36+ < / svelte: fragment>
37+ < / CardGrid>
38+ < / Container>
Original file line number Diff line number Diff line change 3333 title: ' Organizations' ,
3434 event: ' organizations' ,
3535 hasChildren: true
36+ },
37+ {
38+ href: ` ${path }/alerts ` ,
39+ title: ' Alerts' ,
40+ event: ' alerts' ,
3641 }
3742 ];
3843
You can’t perform that action at this time.
0 commit comments