email

package
v0.120.24 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 2 Imported by: 1 module, 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

View Source
const (
	UserInviteTemplate         = "user-invitation"
	WorkflowRunsFailedTemplate = "workflow-runs-failed"
	TokenAlertExpiringTemplate = "token-expiring" // nolint: gosec
	ResourceLimitAlertTemplate = "resource-limit-alert"
	OrganizationInviteTemplate = "organization-invite"
	MagicLinkTemplate          = "magic-link"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailService

type EmailService interface {
	// for clients to show email settings
	IsValid() bool

	SendTenantInviteEmail(ctx context.Context, email string, data TenantInviteEmailData) error
	SendWorkflowRunFailedAlerts(ctx context.Context, emails []string, data WorkflowRunsFailedEmailData) error
	SendExpiringTokenEmail(ctx context.Context, emails []string, data ExpiringTokenEmailData) error
	SendTenantResourceLimitAlert(ctx context.Context, emails []string, data ResourceLimitAlertData) error

	// Used for extending the email provider for sending additional templated emails
	SendTemplateEmail(ctx context.Context, to, templateAlias string, templateModelData interface{}, bccSupport bool) error
	SendTemplateEmailBCC(ctx context.Context, bcc, templateAlias string, templateModelData interface{}, bccSupport bool) error

	SendMagicLinkEmail(ctx context.Context, to string, data MagicLinkEmailData) error
}

type ExpiringTokenEmailData

type ExpiringTokenEmailData struct {
	ExpiresAtAbsoluteDate string `json:"expires_at_absolute_date"`
	ExpiresAtRelativeDate string `json:"expires_at_relative_date"`
	TokenName             string `json:"token_name"`
	Subject               string `json:"subject"`
	TenantName            string `json:"tenant_name"`
	TokenSettings         string `json:"token_settings"`
	SettingsLink          string `json:"settings_link"`
}

type MagicLinkEmailData added in v0.116.14

type MagicLinkEmailData struct {
	ActionURL string `json:"action_url"`
	ExpiresIn string `json:"expires_in"`
}

type NoOpService

type NoOpService struct{}

func (*NoOpService) IsValid

func (s *NoOpService) IsValid() bool

func (*NoOpService) SendExpiringTokenEmail

func (s *NoOpService) SendExpiringTokenEmail(ctx context.Context, emails []string, data ExpiringTokenEmailData) error

func (*NoOpService) SendMagicLinkEmail added in v0.116.14

func (s *NoOpService) SendMagicLinkEmail(ctx context.Context, to string, data MagicLinkEmailData) error

func (*NoOpService) SendTemplateEmail

func (s *NoOpService) SendTemplateEmail(ctx context.Context, to, templateAlias string, templateModelData interface{}, bccSupport bool) error

func (*NoOpService) SendTemplateEmailBCC

func (s *NoOpService) SendTemplateEmailBCC(ctx context.Context, bcc, templateAlias string, templateModelData interface{}, bccSupport bool) error

func (*NoOpService) SendTenantInviteEmail

func (s *NoOpService) SendTenantInviteEmail(ctx context.Context, email string, data TenantInviteEmailData) error

func (*NoOpService) SendTenantResourceLimitAlert

func (s *NoOpService) SendTenantResourceLimitAlert(ctx context.Context, emails []string, data ResourceLimitAlertData) error

func (*NoOpService) SendWorkflowRunFailedAlerts

func (s *NoOpService) SendWorkflowRunFailedAlerts(ctx context.Context, emails []string, data WorkflowRunsFailedEmailData) error

type ResourceLimitAlertData

type ResourceLimitAlertData struct {
	Subject      string `json:"subject"`
	Summary      string `json:"summary"`
	Summary2     string `json:"summary2"`
	TenantName   string `json:"tenant_name"`
	Link         string `json:"link"`
	Resource     string `json:"resource"`
	AlertType    string `json:"alert_type"`
	CurrentValue int    `json:"current_value"`
	LimitValue   int    `json:"limit_value"`
	Percentage   int    `json:"percentage"`
	SettingsLink string `json:"settings_link"`
}

type SendEmailFromTemplateRequest added in v0.78.0

type SendEmailFromTemplateRequest struct {
	TemplateModel interface{} `json:"TemplateModel"`
	From          string      `json:"From"`
	To            string      `json:"To,omitempty"`
	Bcc           string      `json:"Bcc,omitempty"`
	TemplateAlias string      `json:"TemplateAlias"`
}

type TenantInviteEmailData

type TenantInviteEmailData struct {
	InviteSenderName string `json:"invite_sender_name"`
	TenantName       string `json:"tenant_name"`
	ActionURL        string `json:"action_url"`
}

type WorkflowRunsFailedEmailData

type WorkflowRunsFailedEmailData struct {
	Items        []alerttypes.WorkflowRunFailedItem `json:"items"`
	Subject      string                             `json:"subject"`
	Summary      string                             `json:"summary"`
	TenantName   string                             `json:"tenant_name"`
	SettingsLink string                             `json:"settings_link"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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