lot of new functionalities
This commit is contained in:
33
core/application/support.go
Executable file
33
core/application/support.go
Executable file
@@ -0,0 +1,33 @@
|
||||
package application
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
Content string
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) SendSupportMessage(ctx context.Context, comment, userEmail string) error {
|
||||
data := map[string]any{
|
||||
"key": comment,
|
||||
"user": userEmail,
|
||||
}
|
||||
|
||||
supportEmail := h.config.GetString("modules.support.email")
|
||||
if supportEmail == "" {
|
||||
supportEmail = "support@mobicoop.fr"
|
||||
}
|
||||
|
||||
log.Debug().Str("user_email", userEmail).Str("support_email", supportEmail).Msg("Sending support message")
|
||||
|
||||
if err := h.emailing.Send("support.request", supportEmail, data); err != nil {
|
||||
return fmt.Errorf("failed to send support email: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user