feat(web): send test email button (#10011)

* feat(web): test email button

* openapi

* UI button

* Show notification

* pr feedback

* remove jobs

* send email directly from repository and add feedback

* avoid sending many emails

* linter

* pr feedback

* lint

* lint

* lint
This commit is contained in:
Alex 2024-06-07 11:34:09 -05:00 committed by GitHub
parent d5f3d98dfc
commit 9ac2ac2fcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 380 additions and 17 deletions

View file

@ -0,0 +1,19 @@
import { Body, Controller, HttpCode, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { AuthDto } from 'src/dtos/auth.dto';
import { SystemConfigSmtpDto } from 'src/dtos/system-config.dto';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { NotificationService } from 'src/services/notification.service';
@ApiTags('Notifications')
@Controller('notifications')
export class NotificationController {
constructor(private service: NotificationService) {}
@Post('test-email')
@HttpCode(200)
@Authenticated({ admin: true })
sendTestEmail(@Auth() auth: AuthDto, @Body() dto: SystemConfigSmtpDto) {
return this.service.sendTestEmail(auth.user.id, dto);
}
}