Ejemplo n.º 1
0
        public void Validate()
        {
            if (InvitationEmailSettings == null)
            {
                throw new Exception("Invitation email settings are missing");
            }

            InvitationEmailSettings.Validate();

            if (ConfirmAccountEmailSettings == null)
            {
                throw new Exception("Confirm account email settings are missing");
            }

            ConfirmAccountEmailSettings.Validate();

            if (ForgotPasswordEmailSettings == null)
            {
                throw new Exception("Forgot password email settings are missing");
            }

            ForgotPasswordEmailSettings.Validate();

            if (NewUnreadNotificationsEmailSettings == null)
            {
                throw new Exception("New unread notifications email settings are missing");
            }

            NewUnreadNotificationsEmailSettings.Validate();
        }
Ejemplo n.º 2
0
        public void MergeWith(EmailSettingsModel customEmailSettingsModel)
        {
            if (customEmailSettingsModel == null)
            {
                return;
            }

            if (customEmailSettingsModel.InvitationEmailSettings != null)
            {
                if (InvitationEmailSettings == null)
                {
                    InvitationEmailSettings = customEmailSettingsModel.InvitationEmailSettings;
                }
                else
                {
                    InvitationEmailSettings.MergeWith(customEmailSettingsModel.InvitationEmailSettings);
                }
            }

            if (customEmailSettingsModel.ConfirmAccountEmailSettings != null)
            {
                if (ConfirmAccountEmailSettings == null)
                {
                    ConfirmAccountEmailSettings = customEmailSettingsModel.ConfirmAccountEmailSettings;
                }
                else
                {
                    ConfirmAccountEmailSettings.MergeWith(customEmailSettingsModel.ConfirmAccountEmailSettings);
                }
            }

            if (customEmailSettingsModel.ForgotPasswordEmailSettings != null)
            {
                if (ForgotPasswordEmailSettings == null)
                {
                    ForgotPasswordEmailSettings = customEmailSettingsModel.ForgotPasswordEmailSettings;
                }
                else
                {
                    ForgotPasswordEmailSettings.MergeWith(customEmailSettingsModel.ForgotPasswordEmailSettings);
                }
            }

            if (customEmailSettingsModel.NewUnreadNotificationsEmailSettings != null)
            {
                if (NewUnreadNotificationsEmailSettings == null)
                {
                    NewUnreadNotificationsEmailSettings = customEmailSettingsModel.NewUnreadNotificationsEmailSettings;
                }
                else
                {
                    NewUnreadNotificationsEmailSettings.MergeWith(customEmailSettingsModel.NewUnreadNotificationsEmailSettings);
                }
            }

            if (customEmailSettingsModel.CollectionInvitationEmailSettings != null)
            {
                if (CollectionInvitationEmailSettings == null)
                {
                    CollectionInvitationEmailSettings = customEmailSettingsModel.CollectionInvitationEmailSettings;
                }
                else
                {
                    CollectionInvitationEmailSettings.MergeWith(customEmailSettingsModel.CollectionInvitationEmailSettings);
                }
            }

            if (customEmailSettingsModel.CollectionInvitationAcceptedEmailSettings != null)
            {
                if (CollectionInvitationAcceptedEmailSettings == null)
                {
                    CollectionInvitationAcceptedEmailSettings = customEmailSettingsModel.CollectionInvitationAcceptedEmailSettings;
                }
                else
                {
                    CollectionInvitationAcceptedEmailSettings.MergeWith(customEmailSettingsModel.CollectionInvitationAcceptedEmailSettings);
                }
            }

            if (customEmailSettingsModel.CollectionInvitationDeclinedEmailSettings != null)
            {
                if (CollectionInvitationDeclinedEmailSettings == null)
                {
                    CollectionInvitationDeclinedEmailSettings = customEmailSettingsModel.CollectionInvitationDeclinedEmailSettings;
                }
                else
                {
                    CollectionInvitationDeclinedEmailSettings.MergeWith(customEmailSettingsModel.CollectionInvitationDeclinedEmailSettings);
                }
            }

            if (customEmailSettingsModel.DownloadAvailableEmailSettings != null)
            {
                if (DownloadAvailableEmailSettings == null)
                {
                    DownloadAvailableEmailSettings = customEmailSettingsModel.DownloadAvailableEmailSettings;
                }
                else
                {
                    DownloadAvailableEmailSettings.MergeWith(customEmailSettingsModel.DownloadAvailableEmailSettings);
                }
            }

            if (customEmailSettingsModel.DownloadFailedEmailSettings != null)
            {
                if (DownloadFailedEmailSettings == null)
                {
                    DownloadFailedEmailSettings = customEmailSettingsModel.DownloadFailedEmailSettings;
                }
                else
                {
                    DownloadFailedEmailSettings.MergeWith(customEmailSettingsModel.DownloadFailedEmailSettings);
                }
            }

            if (customEmailSettingsModel.DownloadDeclinedEmailSettings != null)
            {
                if (DownloadDeclinedEmailSettings == null)
                {
                    DownloadDeclinedEmailSettings = customEmailSettingsModel.DownloadDeclinedEmailSettings;
                }
                else
                {
                    DownloadDeclinedEmailSettings.MergeWith(customEmailSettingsModel.DownloadDeclinedEmailSettings);
                }
            }

            if (customEmailSettingsModel.AccessRequestDoneEmailSettings != null)
            {
                if (AccessRequestDoneEmailSettings == null)
                {
                    AccessRequestDoneEmailSettings = customEmailSettingsModel.AccessRequestDoneEmailSettings;
                }
                else
                {
                    AccessRequestDoneEmailSettings.MergeWith(customEmailSettingsModel.AccessRequestDoneEmailSettings);
                }
            }

            if (customEmailSettingsModel.AccessRequestDeclinedEmailSettings != null)
            {
                if (AccessRequestDeclinedEmailSettings == null)
                {
                    AccessRequestDeclinedEmailSettings = customEmailSettingsModel.AccessRequestDeclinedEmailSettings;
                }
                else
                {
                    AccessRequestDeclinedEmailSettings.MergeWith(customEmailSettingsModel.AccessRequestDeclinedEmailSettings);
                }
            }

            if (customEmailSettingsModel.PermissionRequestDoneEmailSettings != null)
            {
                if (PermissionRequestDoneEmailSettings == null)
                {
                    PermissionRequestDoneEmailSettings = customEmailSettingsModel.PermissionRequestDoneEmailSettings;
                }
                else
                {
                    PermissionRequestDoneEmailSettings.MergeWith(customEmailSettingsModel.PermissionRequestDoneEmailSettings);
                }
            }

            if (customEmailSettingsModel.PermissionRequestDeclinedEmailSettings != null)
            {
                if (PermissionRequestDeclinedEmailSettings == null)
                {
                    PermissionRequestDeclinedEmailSettings = customEmailSettingsModel.PermissionRequestDeclinedEmailSettings;
                }
                else
                {
                    PermissionRequestDeclinedEmailSettings.MergeWith(customEmailSettingsModel.PermissionRequestDeclinedEmailSettings);
                }
            }
        }