package components import ( "context" "fmt" ) type NotificationFormData struct { NotificationService *struct { ID uint Name string Description string Type string IsEnabled bool EventTriggers []string RetryPolicy string WebhookURL string Method string Headers string PayloadTemplate string SecretKey string PushbulletAPIKey string PushbulletDeviceID string PushbulletTitleTemplate string PushbulletBodyTemplate string NtfyServer string NtfyTopic string NtfyPriority string NtfyUsername string NtfyPassword string NtfyTitleTemplate string NtfyMessageTemplate string GotifyURL string GotifyToken string GotifyPriority string GotifyTitleTemplate string GotifyMessageTemplate string PushoverAPIToken string PushoverUserKey string PushoverDevice string PushoverPriority string PushoverSound string PushoverTitleTemplate string PushoverMessageTemplate string } IsNew bool SuccessMessage string ErrorMessage string } // Helper function to check if a string is in a slice func contains(slice []string, str string) bool { for _, s := range slice { if s == str { return true } } return false } // Helper function to convert bool to string for HTML attributes func boolToString(b bool) string { if b { return "true" } return "" } func getNotificationFormTitle(isNew bool) string { if isNew { return "Add Notification Service" } return "Edit Notification Service" } templ NotificationForm(ctx context.Context, data NotificationFormData) { @LayoutWithContext(getNotificationFormTitle(data.IsNew), ctx) {
if data.SuccessMessage != "" { } if data.ErrorMessage != "" { }

{ getNotificationFormTitle(data.IsNew) }

Back to Notification Services

Configure your notification service to receive alerts for job events. Different notification types have different configuration options.

} }