form

package
v1.49.38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Submit = form.Submit
View Source
var Subscribe = form.Subscribe
View Source
var SubscriberAlreadyExists = errors.New("Subscriber already exists")

Functions

func Query

Types

type Form

type Form struct {
	mixin.Model[Form]

	// Name of list
	Name string `json:"name"`

	// Type of form
	Type form.Type `json:"type"`

	// Whether to send email confirmation
	SendWelcome bool `json:"sendWelcome"`

	// Overwrites default Template Id
	WelcomeTemplateId string `json:"welcomeTemplateId"`

	// Email list settings for this list
	EmailList email.List `json:"emailList,omitempty"`

	// Email forwarding
	Forward struct {
		Email   string `json:"email"`
		Name    string `json:"name"`
		Enabled bool   `json:"enabled"`
	} `json:"forward"`

	// Thank you settings
	ThankYou ThankYou `json:"thankyou"`

	// Conversion tracking info
	Facebook struct {
		Id       string `json:"id"`
		Value    string `json:"value"`
		Currency string `json:"currency"`
	} `json:"facebook"`

	Google struct {
		Category string `json:"category"`
		Name     string `json:"name"`
	} `json:"google"`

	Mailchimp struct {
		ListId string `json:"listId"`
		APIKey string `json:"apiKey"`
	} `json:"mailchimp,omitempty"`
}

func FromJSON

func FromJSON(db *datastore.Datastore, data []byte) *Form

func New

func New(db *datastore.Datastore) *Form

func (*Form) AddSubscriber

func (f *Form) AddSubscriber(s *subscriber.Subscriber) error

func (*Form) Defaults

func (f *Form) Defaults()

func (*Form) Js

func (f *Form) Js() string

func (*Form) Validator

func (f *Form) Validator() *val.Validator

type Settings

type Settings struct {
	// Name of list
	Name string `json:"name"`

	// Type of form
	Type form.Type `json:"type"`

	// Thank you settings
	ThankYou ThankYou `json:"thankyou"`
}

Settings used for injection into form.js

type ThankYou

type ThankYou struct {
	Type thankyou.Type `json:"type"`
	Url  string        `json:"url,omitempty"`
	HTML string        `json:"html,omitempty"`
}

Thank you configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL