emails

package
v3.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyChanged

type APIKeyChanged struct {
	Data
	Identifier string
	Rights     []ttnpb.Right
}

APIKeyChanged is the email that is sent when users updates an API key

func (APIKeyChanged) DefaultTemplates

func (APIKeyChanged) DefaultTemplates() (subject, html, text string)

DefaultTemplates returns the default templates for this email.

func (APIKeyChanged) TemplateName

func (APIKeyChanged) TemplateName() string

TemplateName returns the name of the template to use for this email.

type APIKeyCreated

type APIKeyCreated struct {
	Data
	Identifier string
	Rights     []ttnpb.Right
}

APIKeyCreated is the email that is sent when users creates a new API key

func (APIKeyCreated) DefaultTemplates

func (APIKeyCreated) DefaultTemplates() (subject, html, text string)

DefaultTemplates returns the default templates for this email.

func (APIKeyCreated) TemplateName

func (APIKeyCreated) TemplateName() string

TemplateName returns the name of the template to use for this email.

type CollaboratorChanged

type CollaboratorChanged struct {
	Data
	Collaborator ttnpb.Collaborator
}

CollaboratorChanged is the email that is sent when a collaborator is changed

func (CollaboratorChanged) DefaultTemplates

func (CollaboratorChanged) DefaultTemplates() (subject, html, text string)

DefaultTemplates returns the default templates for this email.

func (CollaboratorChanged) TemplateName

func (CollaboratorChanged) TemplateName() string

TemplateName returns the name of the template to use for this email.

type Data

type Data struct {
	// User we're sending this email to. We need at least an Email.
	User struct {
		ID    string
		Name  string
		Email string
	}

	// Network information to fill into the template.
	Network struct {
		Name              string
		IdentityServerURL string
		ConsoleURL        string
	}

	// Entity this is concerning
	Entity struct {
		Type string
		ID   string
	}

	// Contact details used to inform the user why they are receiving an email.
	// For example:
	//     You are receiving this because you are {{.Contact.Type}} contact on {{.Entity.Type}} {{.Entity.ID}}.
	Contact struct {
		Type string // contact type: technical, billing, abuse; see *ttnpb.ContactInfo
	}
}

Data for emails. Update doc/content/reference/email-templates/available.md when changing fields or adding new emails.

func (Data) Recipient

func (d Data) Recipient() (name, address string)

Recipient returns the recipient info of the email.

func (*Data) SetContact

func (d *Data) SetContact(contact *ttnpb.ContactInfo)

SetContact sets the contact info as recipient of the email.

func (*Data) SetEntity

func (d *Data) SetEntity(ids *ttnpb.EntityIdentifiers)

SetEntity sets the entity that the email is about.

func (*Data) SetUser

func (d *Data) SetUser(user *ttnpb.User)

SetUser sets the user's ID, name and primary email address to the email data. If the user's name is unknown, its ID is used as name.

type EntityStateChanged

type EntityStateChanged struct {
	Data
	State string
}

EntityStateChanged is the email that is sent when the state of an entity was changed.

func (EntityStateChanged) DefaultTemplates

func (EntityStateChanged) DefaultTemplates() (subject, html, text string)

DefaultTemplates returns the default templates for this email.

func (EntityStateChanged) TemplateName

func (EntityStateChanged) TemplateName() string

TemplateName returns the name of the template to use for this email.

type Invitation

type Invitation struct {
	Data
	InvitationToken string
}

Invitation is the email that is sent when a user is invited to the network.

func (Invitation) DefaultTemplates

func (Invitation) DefaultTemplates() (subject, html, text string)

DefaultTemplates returns the default templates for this email.

func (Invitation) TemplateName

func (Invitation) TemplateName() string

TemplateName returns the name of the template to use for this email.

type PasswordChanged

type PasswordChanged struct {
	Data
}

PasswordChanged is the email that is sent when users change their password.

func (PasswordChanged) DefaultTemplates

func (PasswordChanged) DefaultTemplates() (subject, html, text string)

DefaultTemplates returns the default templates for this email.

func (PasswordChanged) TemplateName

func (PasswordChanged) TemplateName() string

TemplateName returns the name of the template to use for this email.

type TemporaryPassword

type TemporaryPassword struct {
	Data
	TemporaryPassword string
}

TemporaryPassword is the email that is sent when users request a temporary password.

func (TemporaryPassword) DefaultTemplates

func (TemporaryPassword) DefaultTemplates() (subject, html, text string)

DefaultTemplates returns the default templates for this email.

func (TemporaryPassword) TemplateName

func (TemporaryPassword) TemplateName() string

TemplateName returns the name of the template to use for this email.

type Validate

type Validate struct {
	Data
	ID    string
	Token string
	TTL   time.Duration
}

Validate is the validation email.

func (Validate) DefaultTemplates

func (Validate) DefaultTemplates() (subject, html, text string)

DefaultTemplates returns the default templates for this email.

func (Validate) TemplateName

func (Validate) TemplateName() string

TemplateName returns the name of the template to use for this email.

Jump to

Keyboard shortcuts

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