@@ -552,6 +552,57 @@ func TestEmailDiff(t *testing.T) {
552552 Content : cast .Ptr ("reauthentication-content" ),
553553 },
554554 },
555+ Notification : map [string ]notification {
556+ "password_changed" : {
557+ Enabled : true ,
558+ emailTemplate : emailTemplate {
559+ Subject : cast .Ptr ("password-changed-subject" ),
560+ Content : cast .Ptr ("password-changed-content" ),
561+ },
562+ },
563+ "email_changed" : {
564+ Enabled : true ,
565+ emailTemplate : emailTemplate {
566+ Subject : cast .Ptr ("email-changed-subject" ),
567+ Content : cast .Ptr ("email-changed-content" ),
568+ },
569+ },
570+ "phone_changed" : {
571+ Enabled : true ,
572+ emailTemplate : emailTemplate {
573+ Subject : cast .Ptr ("phone-changed-subject" ),
574+ Content : cast .Ptr ("phone-changed-content" ),
575+ },
576+ },
577+ "identity_linked" : {
578+ Enabled : true ,
579+ emailTemplate : emailTemplate {
580+ Subject : cast .Ptr ("identity-linked-subject" ),
581+ Content : cast .Ptr ("identity-linked-content" ),
582+ },
583+ },
584+ "identity_unlinked" : {
585+ Enabled : true ,
586+ emailTemplate : emailTemplate {
587+ Subject : cast .Ptr ("identity-unlinked-subject" ),
588+ Content : cast .Ptr ("identity-unlinked-content" ),
589+ },
590+ },
591+ "mfa_factor_enrolled" : {
592+ Enabled : true ,
593+ emailTemplate : emailTemplate {
594+ Subject : cast .Ptr ("mfa-enrolled-subject" ),
595+ Content : cast .Ptr ("mfa-enrolled-content" ),
596+ },
597+ },
598+ "mfa_factor_unenrolled" : {
599+ Enabled : true ,
600+ emailTemplate : emailTemplate {
601+ Subject : cast .Ptr ("mfa-unenrolled-subject" ),
602+ Content : cast .Ptr ("mfa-unenrolled-content" ),
603+ },
604+ },
605+ },
555606 Smtp : & smtp {
556607 Enabled : true ,
557608 Host : "smtp.sendgrid.net" ,
@@ -596,6 +647,28 @@ func TestEmailDiff(t *testing.T) {
596647 MailerTemplatesEmailChangeContent : nullable .NewNullableWithValue ("email-change-content" ),
597648 MailerSubjectsReauthentication : nullable .NewNullableWithValue ("reauthentication-subject" ),
598649 MailerTemplatesReauthenticationContent : nullable .NewNullableWithValue ("reauthentication-content" ),
650+ // Notifications
651+ MailerNotificationsPasswordChangedEnabled : nullable .NewNullableWithValue (true ),
652+ MailerSubjectsPasswordChangedNotification : nullable .NewNullableWithValue ("password-changed-subject" ),
653+ MailerTemplatesPasswordChangedNotificationContent : nullable .NewNullableWithValue ("password-changed-content" ),
654+ MailerNotificationsEmailChangedEnabled : nullable .NewNullableWithValue (true ),
655+ MailerSubjectsEmailChangedNotification : nullable .NewNullableWithValue ("email-changed-subject" ),
656+ MailerTemplatesEmailChangedNotificationContent : nullable .NewNullableWithValue ("email-changed-content" ),
657+ MailerNotificationsPhoneChangedEnabled : nullable .NewNullableWithValue (true ),
658+ MailerSubjectsPhoneChangedNotification : nullable .NewNullableWithValue ("phone-changed-subject" ),
659+ MailerTemplatesPhoneChangedNotificationContent : nullable .NewNullableWithValue ("phone-changed-content" ),
660+ MailerNotificationsIdentityLinkedEnabled : nullable .NewNullableWithValue (true ),
661+ MailerSubjectsIdentityLinkedNotification : nullable .NewNullableWithValue ("identity-linked-subject" ),
662+ MailerTemplatesIdentityLinkedNotificationContent : nullable .NewNullableWithValue ("identity-linked-content" ),
663+ MailerNotificationsIdentityUnlinkedEnabled : nullable .NewNullableWithValue (true ),
664+ MailerSubjectsIdentityUnlinkedNotification : nullable .NewNullableWithValue ("identity-unlinked-subject" ),
665+ MailerTemplatesIdentityUnlinkedNotificationContent : nullable .NewNullableWithValue ("identity-unlinked-content" ),
666+ MailerNotificationsMfaFactorEnrolledEnabled : nullable .NewNullableWithValue (true ),
667+ MailerSubjectsMfaFactorEnrolledNotification : nullable .NewNullableWithValue ("mfa-enrolled-subject" ),
668+ MailerTemplatesMfaFactorEnrolledNotificationContent : nullable .NewNullableWithValue ("mfa-enrolled-content" ),
669+ MailerNotificationsMfaFactorUnenrolledEnabled : nullable .NewNullableWithValue (true ),
670+ MailerSubjectsMfaFactorUnenrolledNotification : nullable .NewNullableWithValue ("mfa-unenrolled-subject" ),
671+ MailerTemplatesMfaFactorUnenrolledNotificationContent : nullable .NewNullableWithValue ("mfa-unenrolled-content" ),
599672 })
600673 // Check error
601674 assert .NoError (t , err )
@@ -633,6 +706,45 @@ func TestEmailDiff(t *testing.T) {
633706 Content : cast .Ptr ("" ),
634707 },
635708 },
709+ Notification : map [string ]notification {
710+ "password_changed" : {
711+ Enabled : true ,
712+ emailTemplate : emailTemplate {
713+ Subject : cast .Ptr ("password-changed-subject" ),
714+ Content : cast .Ptr ("password-changed-content" ),
715+ },
716+ },
717+ "email_changed" : {
718+ Enabled : true ,
719+ emailTemplate : emailTemplate {
720+ Subject : cast .Ptr ("email-changed-subject" ),
721+ Content : cast .Ptr ("email-changed-content" ),
722+ },
723+ },
724+ "phone_changed" : {
725+ Enabled : true ,
726+ emailTemplate : emailTemplate {
727+ Subject : cast .Ptr ("phone-changed-subject" ),
728+ Content : cast .Ptr ("phone-changed-content" ),
729+ },
730+ },
731+ "identity_linked" : {
732+ Enabled : true ,
733+ emailTemplate : emailTemplate {
734+ Subject : cast .Ptr ("identity-linked-subject" ),
735+ Content : cast .Ptr ("identity-linked-content" ),
736+ },
737+ },
738+ "identity_unlinked" : {
739+ Enabled : true ,
740+ },
741+ "mfa_factor_enrolled" : {
742+ Enabled : true ,
743+ },
744+ "mfa_factor_unenrolled" : {
745+ Enabled : true ,
746+ },
747+ },
636748 Smtp : & smtp {
637749 Enabled : true ,
638750 Host : "smtp.sendgrid.net" ,
@@ -663,6 +775,21 @@ func TestEmailDiff(t *testing.T) {
663775 MailerSubjectsRecovery : nullable .NewNullableWithValue ("recovery-subject" ),
664776 MailerSubjectsMagicLink : nullable .NewNullableWithValue ("magic-link-subject" ),
665777 MailerTemplatesEmailChangeContent : nullable .NewNullableWithValue ("email-change-content" ),
778+ // Notifications
779+ MailerNotificationsPasswordChangedEnabled : nullable .NewNullableWithValue (false ),
780+ MailerSubjectsPasswordChangedNotification : nullable .NewNullableWithValue ("password-changed-subject" ),
781+ MailerTemplatesPasswordChangedNotificationContent : nullable .NewNullableWithValue ("password-changed-content" ),
782+ MailerNotificationsEmailChangedEnabled : nullable .NewNullableWithValue (false ),
783+ MailerSubjectsEmailChangedNotification : nullable .NewNullableWithValue ("email-changed-subject" ),
784+ MailerNotificationsPhoneChangedEnabled : nullable .NewNullableWithValue (false ),
785+ MailerTemplatesPhoneChangedNotificationContent : nullable .NewNullableWithValue ("phone-changed-content" ),
786+ MailerNotificationsIdentityLinkedEnabled : nullable .NewNullableWithValue (false ),
787+ MailerNotificationsIdentityUnlinkedEnabled : nullable .NewNullableWithValue (false ),
788+ MailerSubjectsIdentityUnlinkedNotification : nullable .NewNullableWithValue ("identity-unlinked-subject" ),
789+ MailerTemplatesIdentityUnlinkedNotificationContent : nullable .NewNullableWithValue ("identity-unlinked-content" ),
790+ MailerNotificationsMfaFactorEnrolledEnabled : nullable .NewNullableWithValue (false ),
791+ MailerSubjectsMfaFactorEnrolledNotification : nullable .NewNullableWithValue ("mfa-enrolled-subject" ),
792+ MailerNotificationsMfaFactorUnenrolledEnabled : nullable .NewNullableWithValue (false ),
666793 })
667794 // Check error
668795 assert .NoError (t , err )
@@ -681,6 +808,15 @@ func TestEmailDiff(t *testing.T) {
681808 "email_change" : {},
682809 "reauthentication" : {},
683810 },
811+ Notification : map [string ]notification {
812+ "password_changed" : {},
813+ "email_changed" : {},
814+ "phone_changed" : {},
815+ "identity_linked" : {},
816+ "identity_unlinked" : {},
817+ "mfa_factor_enrolled" : {},
818+ "mfa_factor_unenrolled" : {},
819+ },
684820 MaxFrequency : time .Minute ,
685821 OtpLength : 8 ,
686822 OtpExpiry : 86400 ,
@@ -713,6 +849,24 @@ func TestEmailDiff(t *testing.T) {
713849 MailerTemplatesEmailChangeContent : nullable .NewNullableWithValue ("email-change-content" ),
714850 MailerSubjectsReauthentication : nullable .NewNullableWithValue ("reauthentication-subject" ),
715851 MailerTemplatesReauthenticationContent : nullable .NewNullableWithValue ("reauthentication-content" ),
852+ // Notifications
853+ MailerNotificationsPasswordChangedEnabled : nullable .NewNullableWithValue (true ),
854+ MailerSubjectsPasswordChangedNotification : nullable .NewNullableWithValue ("password-changed-subject" ),
855+ MailerTemplatesPasswordChangedNotificationContent : nullable .NewNullableWithValue ("password-changed-content" ),
856+ MailerNotificationsEmailChangedEnabled : nullable .NewNullableWithValue (true ),
857+ MailerSubjectsEmailChangedNotification : nullable .NewNullableWithValue ("email-changed-subject" ),
858+ MailerNotificationsPhoneChangedEnabled : nullable .NewNullableWithValue (true ),
859+ MailerTemplatesPhoneChangedNotificationContent : nullable .NewNullableWithValue ("phone-changed-content" ),
860+ MailerNotificationsIdentityLinkedEnabled : nullable .NewNullableWithValue (true ),
861+ MailerNotificationsIdentityUnlinkedEnabled : nullable .NewNullableWithValue (true ),
862+ MailerSubjectsIdentityUnlinkedNotification : nullable .NewNullableWithValue ("identity-unlinked-subject" ),
863+ MailerTemplatesIdentityUnlinkedNotificationContent : nullable .NewNullableWithValue ("identity-unlinked-content" ),
864+ MailerNotificationsMfaFactorEnrolledEnabled : nullable .NewNullableWithValue (true ),
865+ MailerSubjectsMfaFactorEnrolledNotification : nullable .NewNullableWithValue ("mfa-enrolled-subject" ),
866+ MailerTemplatesMfaFactorEnrolledNotificationContent : nullable .NewNullableWithValue ("mfa-enrolled-content" ),
867+ MailerNotificationsMfaFactorUnenrolledEnabled : nullable .NewNullableWithValue (true ),
868+ MailerSubjectsMfaFactorUnenrolledNotification : nullable .NewNullableWithValue ("mfa-unenrolled-subject" ),
869+ MailerTemplatesMfaFactorUnenrolledNotificationContent : nullable .NewNullableWithValue ("mfa-unenrolled-content" ),
716870 })
717871 // Check error
718872 assert .NoError (t , err )
@@ -731,6 +885,15 @@ func TestEmailDiff(t *testing.T) {
731885 "email_change" : {},
732886 "reauthentication" : {},
733887 },
888+ Notification : map [string ]notification {
889+ "password_changed" : {},
890+ "email_changed" : {},
891+ "phone_changed" : {},
892+ "identity_linked" : {},
893+ "identity_unlinked" : {},
894+ "mfa_factor_enrolled" : {},
895+ "mfa_factor_unenrolled" : {},
896+ },
734897 Smtp : & smtp {
735898 Enabled : false ,
736899 Host : "smtp.sendgrid.net" ,
0 commit comments