email

package
v6.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: AGPL-3.0, Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenTypePasswordRecovery = "password_recovery"
	TokenTypeVerifyEmail      = "verify_email"
	TokenTypeTeamInvitation   = "team_invitation"
	TokenTypeGuestInvitation  = "guest_invitation"
	TokenTypeCWSAccess        = "cws_access_token"
)
View Source
const (
	EmailBatchingTaskName = "Email Batching"
)

Variables

View Source
var (
	CreateEmailTokenError  = errors.New("could not create token")
	NoRateLimiterError     = errors.New("the rate limit could not be found")
	SetupRateLimiterError  = errors.New("the rate limiter could not be set")
	RateLimitExceededError = errors.New("the rate limit is exceeded")
)

Functions

This section is empty.

Types

type EmailBatchingJob

type EmailBatchingJob struct {
	// contains filtered or unexported fields
}

func NewEmailBatchingJob

func NewEmailBatchingJob(es *Service, bufferSize int) *EmailBatchingJob

func (*EmailBatchingJob) Add

func (job *EmailBatchingJob) Add(user *model.User, post *model.Post, team *model.Team) bool

func (*EmailBatchingJob) CheckPendingEmails

func (job *EmailBatchingJob) CheckPendingEmails()

func (*EmailBatchingJob) Start

func (job *EmailBatchingJob) Start()

type Service

type Service struct {
	PerHourEmailRateLimiter *throttled.GCRARateLimiter
	PerDayEmailRateLimiter  *throttled.GCRARateLimiter
	EmailBatching           *EmailBatchingJob
	// contains filtered or unexported fields
}

func NewService

func NewService(config ServiceConfig) (*Service, error)

func (*Service) AddNotificationEmailToBatch

func (es *Service) AddNotificationEmailToBatch(user *model.User, post *model.Post, team *model.Team) *model.AppError

func (*Service) CreateVerifyEmailToken

func (es *Service) CreateVerifyEmailToken(userID string, newEmail string) (*model.Token, error)

func (*Service) GetMessageForNotification

func (es *Service) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string

func (*Service) InitEmailBatching

func (es *Service) InitEmailBatching()

func (*Service) InvalidateVerifyEmailTokensForUser

func (es *Service) InvalidateVerifyEmailTokensForUser(userID string) *model.AppError

func (*Service) NewEmailTemplateData

func (es *Service) NewEmailTemplateData(locale string) templates.Data

func (*Service) SendAtUserLimitWarningEmail

func (es *Service) SendAtUserLimitWarningEmail(email string, locale string, siteURL string) (bool, error)

func (*Service) SendChangeUsernameEmail

func (es *Service) SendChangeUsernameEmail(newUsername, email, locale, siteURL string) error

func (*Service) SendCloudTrialEndWarningEmail

func (es *Service) SendCloudTrialEndWarningEmail(userEmail, name, trialEndDate, locale, siteURL string) error

func (*Service) SendCloudTrialEndedEmail

func (es *Service) SendCloudTrialEndedEmail(userEmail, name, locale, siteURL string) error

func (*Service) SendCloudWelcomeEmail

func (es *Service) SendCloudWelcomeEmail(userEmail, locale, teamInviteID, workSpaceName, dns, siteURL string) error

SendCloudWelcomeEmail sends the cloud version of the welcome email

func (*Service) SendDeactivateAccountEmail

func (es *Service) SendDeactivateAccountEmail(email string, locale, siteURL string) error

func (*Service) SendEmailChangeEmail

func (es *Service) SendEmailChangeEmail(oldEmail, newEmail, locale, siteURL string) error

func (*Service) SendEmailChangeVerifyEmail

func (es *Service) SendEmailChangeVerifyEmail(newUserEmail, locale, siteURL, token string) error

func (*Service) SendGuestInviteEmails

func (es *Service) SendGuestInviteEmails(team *model.Team, channels []*model.Channel, senderName string, senderUserId string, senderProfileImage []byte, invites []string, siteURL string, message string) error

func (*Service) SendInviteEmails

func (es *Service) SendInviteEmails(team *model.Team, senderName string, senderUserId string, invites []string, siteURL string) error

func (*Service) SendLicenseUpForRenewalEmail

func (es *Service) SendLicenseUpForRenewalEmail(email, name, locale, siteURL, renewalLink string, daysToExpiration int) error

func (*Service) SendMailWithEmbeddedFiles

func (es *Service) SendMailWithEmbeddedFiles(to, subject, htmlBody string, embeddedFiles map[string]io.Reader) error

func (*Service) SendMfaChangeEmail

func (es *Service) SendMfaChangeEmail(email string, activated bool, locale, siteURL string) error

func (*Service) SendNoCardPaymentFailedEmail

func (es *Service) SendNoCardPaymentFailedEmail(email string, locale string, siteURL string) error

func (*Service) SendNotificationMail

func (es *Service) SendNotificationMail(to, subject, htmlBody string) error

func (*Service) SendOverUserFourteenDayWarningEmail

func (es *Service) SendOverUserFourteenDayWarningEmail(email string, locale string, siteURL string, overLimitDate string) (bool, error)

func (*Service) SendOverUserLimitNinetyDayWarningEmail

func (es *Service) SendOverUserLimitNinetyDayWarningEmail(email string, locale string, siteURL string, overLimitDate string) (bool, error)

func (*Service) SendOverUserLimitThirtyDayWarningEmail

func (es *Service) SendOverUserLimitThirtyDayWarningEmail(email string, locale string, siteURL string) (bool, error)

func (*Service) SendOverUserLimitWarningEmail

func (es *Service) SendOverUserLimitWarningEmail(email string, locale string, siteURL string) (bool, error)

func (*Service) SendOverUserLimitWorkspaceSuspendedWarningEmail

func (es *Service) SendOverUserLimitWorkspaceSuspendedWarningEmail(email string, locale string, siteURL string) (bool, error)

func (*Service) SendOverUserSevenDayWarningEmail

func (es *Service) SendOverUserSevenDayWarningEmail(email string, locale string, siteURL string) (bool, error)

func (*Service) SendPasswordChangeEmail

func (es *Service) SendPasswordChangeEmail(email, method, locale, siteURL string) error

func (*Service) SendPasswordResetEmail

func (es *Service) SendPasswordResetEmail(email string, token *model.Token, locale, siteURL string) (bool, error)

func (*Service) SendPaymentFailedEmail

func (es *Service) SendPaymentFailedEmail(email string, locale string, failedPayment *model.FailedPayment, siteURL string) (bool, error)

func (*Service) SendRemoveExpiredLicenseEmail

func (es *Service) SendRemoveExpiredLicenseEmail(renewalLink, email string, locale, siteURL string) error

SendRemoveExpiredLicenseEmail formats an email and uses the email service to send the email to user with link pointing to CWS to renew the user license

func (*Service) SendSignInChangeEmail

func (es *Service) SendSignInChangeEmail(email, method, locale, siteURL string) error

func (*Service) SendSuspensionEmailToSupport

func (es *Service) SendSuspensionEmailToSupport(email string, installationID string, customerID string, subscriptionID string, siteURL string, userCount int64) (bool, error)

func (*Service) SendUpgradeEmail

func (es *Service) SendUpgradeEmail(user, email, locale, siteURL, action string) (bool, error)

SendUpgradeEmail formats an email template and sends an email to an admin specified in the email arg

func (*Service) SendUserAccessTokenAddedEmail

func (es *Service) SendUserAccessTokenAddedEmail(email, locale, siteURL string) error

func (*Service) SendVerifyEmail

func (es *Service) SendVerifyEmail(userEmail, locale, siteURL, token, redirect string) error

func (*Service) SendWelcomeEmail

func (es *Service) SendWelcomeEmail(userID string, email string, verified bool, disableWelcomeEmail bool, locale, siteURL, redirect string) error

type ServiceConfig

type ServiceConfig struct {
	ConfigFn  func() *model.Config
	LicenseFn func() *model.License
	GoFn      func(f func())

	TemplatesContainer *templates.Container
	UserService        *users.UserService
	Store              store.Store
}

Jump to

Keyboard shortcuts

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