ngOnInit () {
this.buildForm({
- moderationResponse: REGISTRATION_MODERATION_RESPONSE_VALIDATOR
+ moderationResponse: REGISTRATION_MODERATION_RESPONSE_VALIDATOR,
+ preventEmailDelivery: null
})
}
this.processMode = mode
this.registration = registration
+ this.form.patchValue({
+ preventEmailDelivery: !this.isEmailEnabled() || registration.emailVerified !== true
+ })
+
this.openedModal = this.modalService.open(this.modal, { centered: true })
}
return this.server.getHTMLConfig().email.enabled
}
- private acceptRegistration () {
- this.registrationService.acceptRegistration(this.registration, this.form.value.moderationResponse)
- .subscribe({
- next: () => {
- this.notifier.success($localize`${this.registration.username} account created`)
-
- this.registrationProcessed.emit()
- this.hide()
- },
+ isPreventEmailDeliveryChecked () {
+ return this.form.value.preventEmailDelivery
+ }
- error: err => this.notifier.error(err.message)
- })
+ private acceptRegistration () {
+ this.registrationService.acceptRegistration({
+ registration: this.registration,
+ moderationResponse: this.form.value.moderationResponse,
+ preventEmailDelivery: this.form.value.preventEmailDelivery
+ }).subscribe({
+ next: () => {
+ this.notifier.success($localize`${this.registration.username} account created`)
+
+ this.registrationProcessed.emit()
+ this.hide()
+ },
+
+ error: err => this.notifier.error(err.message)
+ })
}
private rejectRegistration () {
- this.registrationService.rejectRegistration(this.registration, this.form.value.moderationResponse)
- .subscribe({
- next: () => {
- this.notifier.success($localize`${this.registration.username} registration rejected`)
-
- this.registrationProcessed.emit()
- this.hide()
- },
-
- error: err => this.notifier.error(err.message)
- })
+ this.registrationService.rejectRegistration({
+ registration: this.registration,
+ moderationResponse: this.form.value.moderationResponse,
+ preventEmailDelivery: this.form.value.preventEmailDelivery
+ }).subscribe({
+ next: () => {
+ this.notifier.success($localize`${this.registration.username} registration rejected`)
+
+ this.registrationProcessed.emit()
+ this.hide()
+ },
+
+ error: err => this.notifier.error(err.message)
+ })
}
}