feat: mailer internal, templates, bruno cleanup, create user, send welcome mail, mailtrap

This commit is contained in:
2026-03-26 09:46:32 +01:00
parent 095f7aabeb
commit bedc010584
16 changed files with 311 additions and 4 deletions
+16
View File
@@ -175,3 +175,19 @@ func (app *application) readInt(qs url.Values, key string, defaultValue int, v *
// Otherwise, return the converted integer value.
return i
}
// The background() helper accepts an arbitrary function as a parameter.
func (app *application) background(fn func()) {
// Launch a background goroutine.
go func() {
// Recover any panic.
defer func() {
if err := recover(); err != nil {
app.logger.PrintError(fmt.Errorf("%s", err), nil)
}
}()
// Execute the arbitrary function that we passed as the parameter.
fn()
}()
}