- Backend: Email producer (LavinMQ), EmailService interface - Backend: CRUD API for email_templates and email_settings - Backend: avatar_url field in users table + UpdateMyProfile support - Backend: StorageService for pre-signed URLs - NestJS: Email consumer with Nodemailer and Handlebars - Frontend: Email Templates admin pages (list/edit) - Frontend: Updated profileApi.uploadAvatar with pre-signed URL flow - Frontend: New /post-job public page (company registration + job creation wizard) - Migrations: 027_create_email_system.sql, 028_add_avatar_url_to_users.sql
58 lines
2.1 KiB
Go
58 lines
2.1 KiB
Go
package dto
|
|
|
|
import "time"
|
|
|
|
// EmailTemplateDTO represents an email template for API responses
|
|
type EmailTemplateDTO struct {
|
|
ID string `json:"id"`
|
|
Slug string `json:"slug"`
|
|
Subject string `json:"subject"`
|
|
BodyHTML string `json:"body_html"`
|
|
Variables []string `json:"variables"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// CreateEmailTemplateRequest for creating new templates
|
|
type CreateEmailTemplateRequest struct {
|
|
Slug string `json:"slug"`
|
|
Subject string `json:"subject"`
|
|
BodyHTML string `json:"body_html"`
|
|
Variables []string `json:"variables"`
|
|
}
|
|
|
|
// UpdateEmailTemplateRequest for updating existing templates
|
|
type UpdateEmailTemplateRequest struct {
|
|
Subject *string `json:"subject,omitempty"`
|
|
BodyHTML *string `json:"body_html,omitempty"`
|
|
Variables *[]string `json:"variables,omitempty"`
|
|
}
|
|
|
|
// EmailSettingsDTO represents email settings for API responses
|
|
type EmailSettingsDTO struct {
|
|
ID string `json:"id"`
|
|
Provider string `json:"provider"`
|
|
SMTPHost *string `json:"smtp_host,omitempty"`
|
|
SMTPPort *int `json:"smtp_port,omitempty"`
|
|
SMTPUser *string `json:"smtp_user,omitempty"`
|
|
SMTPPass *string `json:"smtp_pass,omitempty"` // Should be masked in responses
|
|
SMTPSecure bool `json:"smtp_secure"`
|
|
SenderName string `json:"sender_name"`
|
|
SenderEmail string `json:"sender_email"`
|
|
AMQPURL *string `json:"amqp_url,omitempty"` // LavinMQ connection
|
|
IsActive bool `json:"is_active"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// UpdateEmailSettingsRequest for updating email settings
|
|
type UpdateEmailSettingsRequest struct {
|
|
Provider *string `json:"provider,omitempty"`
|
|
SMTPHost *string `json:"smtp_host,omitempty"`
|
|
SMTPPort *int `json:"smtp_port,omitempty"`
|
|
SMTPUser *string `json:"smtp_user,omitempty"`
|
|
SMTPPass *string `json:"smtp_pass,omitempty"`
|
|
SMTPSecure *bool `json:"smtp_secure,omitempty"`
|
|
SenderName *string `json:"sender_name,omitempty"`
|
|
SenderEmail *string `json:"sender_email,omitempty"`
|
|
AMQPURL *string `json:"amqp_url,omitempty"`
|
|
}
|