emails

package
v0.0.0-...-60b8695 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 5 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
	Key    *ttnpb.APIKey
	Rights []ttnpb.Right
}

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

func (APIKeyChanged) ConsoleURL

func (a APIKeyChanged) ConsoleURL() string

ConsoleURL returns the URL to the API key in the Console.

func (APIKeyChanged) DefaultTemplates

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

DefaultTemplates returns the default templates for this email.

func (APIKeyChanged) Identifier

func (a APIKeyChanged) Identifier() string

Identifier returns the pretty name of the API key. The naming of this method is for compatibility reasons.

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
	Key    *ttnpb.APIKey
	Rights []ttnpb.Right
}

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

func (APIKeyCreated) ConsoleURL

func (a APIKeyCreated) ConsoleURL() string

ConsoleURL returns the URL to the API key in the Console.

func (APIKeyCreated) DefaultTemplates

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

DefaultTemplates returns the default templates for this email.

func (APIKeyCreated) Identifier

func (a APIKeyCreated) Identifier() string

Identifier returns the pretty name of the API key. The naming of this method is for compatibility reasons.

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) ConsoleURL

func (c CollaboratorChanged) ConsoleURL() string

ConsoleURL returns the URL to the collaborator in the Console.

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 https://github.com/TheThingsIndustries/lorawan-stack-docs/blob/master/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
	StateDescription 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
	TTL             time.Duration
}

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) FormatTTL

func (i Invitation) FormatTTL() string

FormatTTL formats the TTL.

func (Invitation) TemplateName

func (Invitation) TemplateName() string

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

type LoginToken

type LoginToken struct {
	Data
	LoginToken string
	TTL        time.Duration
}

LoginToken is the email that is sent when users request a login token.

func (LoginToken) DefaultTemplates

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

DefaultTemplates returns the default templates for this email.

func (LoginToken) FormatTTL

func (t LoginToken) FormatTTL() string

FormatTTL formats the TTL.

func (LoginToken) TemplateName

func (LoginToken) 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
	TTL               time.Duration
}

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) FormatTTL

func (t TemporaryPassword) FormatTTL() string

FormatTTL formats the TTL.

func (TemporaryPassword) TemplateName

func (TemporaryPassword) TemplateName() string

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

type UserRequested

type UserRequested struct {
	Data
}

UserRequested is the email that is sent to admins when a user requests to join the network.

func (UserRequested) ConsoleURL

func (u UserRequested) ConsoleURL() string

ConsoleURL returns the URL to the user in the Console.

func (UserRequested) DefaultTemplates

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

DefaultTemplates returns the default templates for this email.

func (UserRequested) TemplateName

func (UserRequested) 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) FormatTTL

func (v Validate) FormatTTL() string

FormatTTL formats the TTL.

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