Documentation ¶
Index ¶
- Constants
- Variables
- type EmailBatchingJob
- type Service
- func (es *Service) AddNotificationEmailToBatch(user *model.User, post *model.Post, team *model.Team) *model.AppError
- func (es *Service) CreateVerifyEmailToken(userID string, newEmail string) (*model.Token, error)
- func (es *Service) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string
- func (es *Service) GetPerDayEmailRateLimiter() *throttled.GCRARateLimiter
- func (es *Service) GetPerHourEmailRateLimiter() *throttled.GCRARateLimiter
- func (es *Service) InitEmailBatching()
- func (es *Service) InvalidateVerifyEmailTokensForUser(userID string) *model.AppError
- func (es *Service) NewEmailTemplateData(locale string) templates.Data
- func (es *Service) SendChangeUsernameEmail(newUsername, email, locale, siteURL string) error
- func (es *Service) SendCloudTrialEndWarningEmail(userEmail, name, trialEndDate, locale, siteURL string) error
- func (es *Service) SendCloudTrialEndedEmail(userEmail, name, locale, siteURL string) error
- func (es *Service) SendCloudWelcomeEmail(userEmail, locale, teamInviteID, workSpaceName, dns, siteURL string) error
- func (es *Service) SendDeactivateAccountEmail(email string, locale, siteURL string) error
- func (es *Service) SendEmailChangeEmail(oldEmail, newEmail, locale, siteURL string) error
- func (es *Service) SendEmailChangeVerifyEmail(newUserEmail, locale, siteURL, token string) error
- func (es *Service) SendGuestInviteEmails(team *model.Team, channels []*model.Channel, senderName string, ...) error
- func (es *Service) SendInviteEmails(team *model.Team, senderName string, senderUserId string, invites []string, ...) error
- func (es *Service) SendInviteEmailsToTeamAndChannels(team *model.Team, channels []*model.Channel, senderName string, ...) ([]*model.EmailInviteWithError, error)
- func (es *Service) SendLicenseInactivityEmail(email, name, locale, siteURL string) error
- func (es *Service) SendLicenseUpForRenewalEmail(email, name, locale, siteURL, renewalLink string, daysToExpiration int) error
- func (es *Service) SendMailWithEmbeddedFiles(to, subject, htmlBody string, embeddedFiles map[string]io.Reader) error
- func (es *Service) SendMfaChangeEmail(email string, activated bool, locale, siteURL string) error
- func (es *Service) SendNoCardPaymentFailedEmail(email string, locale string, siteURL string) error
- func (es *Service) SendNotificationMail(to, subject, htmlBody string) error
- func (es *Service) SendPasswordChangeEmail(email, method, locale, siteURL string) error
- func (es *Service) SendPasswordResetEmail(email string, token *model.Token, locale, siteURL string) (bool, error)
- func (es *Service) SendPaymentFailedEmail(email string, locale string, failedPayment *model.FailedPayment, ...) (bool, error)
- func (es *Service) SendRemoveExpiredLicenseEmail(renewalLink, email string, locale, siteURL string) error
- func (es *Service) SendSignInChangeEmail(email, method, locale, siteURL string) error
- func (es *Service) SendUserAccessTokenAddedEmail(email, locale, siteURL string) error
- func (es *Service) SendVerifyEmail(userEmail, locale, siteURL, token, redirect string) error
- func (es *Service) SendWelcomeEmail(userID string, email string, verified bool, disableWelcomeEmail bool, ...) error
- type ServiceConfig
- type ServiceInterface
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") SendMailError = errors.New("could not send the email") )
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) CheckPendingEmails ¶
func (job *EmailBatchingJob) CheckPendingEmails()
func (*EmailBatchingJob) Start ¶
func (job *EmailBatchingJob) Start()
type Service ¶
type Service struct { EmailBatching *EmailBatchingJob // contains filtered or unexported fields }
func NewService ¶
func NewService(config ServiceConfig) (*Service, error)
func (*Service) AddNotificationEmailToBatch ¶
func (*Service) CreateVerifyEmailToken ¶
func (*Service) GetMessageForNotification ¶
func (*Service) GetPerDayEmailRateLimiter ¶
func (es *Service) GetPerDayEmailRateLimiter() *throttled.GCRARateLimiter
func (*Service) GetPerHourEmailRateLimiter ¶
func (es *Service) GetPerHourEmailRateLimiter() *throttled.GCRARateLimiter
func (*Service) InitEmailBatching ¶
func (es *Service) InitEmailBatching()
func (*Service) InvalidateVerifyEmailTokensForUser ¶
func (*Service) NewEmailTemplateData ¶
func (*Service) SendChangeUsernameEmail ¶
func (*Service) SendCloudTrialEndWarningEmail ¶
func (*Service) SendCloudTrialEndedEmail ¶
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 (*Service) SendEmailChangeEmail ¶
func (*Service) SendEmailChangeVerifyEmail ¶
func (*Service) SendGuestInviteEmails ¶
func (*Service) SendInviteEmails ¶
func (*Service) SendInviteEmailsToTeamAndChannels ¶
func (es *Service) SendInviteEmailsToTeamAndChannels( team *model.Team, channels []*model.Channel, senderName string, senderUserId string, senderProfileImage []byte, invites []string, siteURL string, reminderData *model.TeamInviteReminderData, message string, errorWhenNotSent bool, ) ([]*model.EmailInviteWithError, error)
func (*Service) SendLicenseInactivityEmail ¶
func (*Service) SendLicenseUpForRenewalEmail ¶
func (*Service) SendMailWithEmbeddedFiles ¶
func (*Service) SendMfaChangeEmail ¶
func (*Service) SendNoCardPaymentFailedEmail ¶
func (*Service) SendNotificationMail ¶
func (*Service) SendPasswordChangeEmail ¶
func (*Service) SendPasswordResetEmail ¶
func (*Service) SendPaymentFailedEmail ¶
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 (*Service) SendUserAccessTokenAddedEmail ¶
func (*Service) SendVerifyEmail ¶
type ServiceConfig ¶
type ServiceInterface ¶
type ServiceInterface interface { GetPerDayEmailRateLimiter() *throttled.GCRARateLimiter NewEmailTemplateData(locale string) templates.Data SendEmailChangeVerifyEmail(newUserEmail, locale, siteURL, token string) error SendEmailChangeEmail(oldEmail, newEmail, locale, siteURL string) error SendVerifyEmail(userEmail, locale, siteURL, token, redirect string) error SendSignInChangeEmail(email, method, locale, siteURL string) error SendWelcomeEmail(userID string, email string, verified bool, disableWelcomeEmail bool, locale, siteURL, redirect string) error SendCloudTrialEndWarningEmail(userEmail, name, trialEndDate, locale, siteURL string) error SendCloudTrialEndedEmail(userEmail, name, locale, siteURL string) error SendCloudWelcomeEmail(userEmail, locale, teamInviteID, workSpaceName, dns, siteURL string) error SendPasswordChangeEmail(email, method, locale, siteURL string) error SendUserAccessTokenAddedEmail(email, locale, siteURL string) error SendPasswordResetEmail(email string, token *model.Token, locale, siteURL string) (bool, error) SendMfaChangeEmail(email string, activated bool, locale, siteURL string) error SendInviteEmails(team *model.Team, senderName string, senderUserId string, invites []string, siteURL string, reminderData *model.TeamInviteReminderData, errorWhenNotSent bool) error SendGuestInviteEmails(team *model.Team, channels []*model.Channel, senderName string, senderUserId string, senderProfileImage []byte, invites []string, siteURL string, message string, errorWhenNotSent bool) error SendInviteEmailsToTeamAndChannels(team *model.Team, channels []*model.Channel, senderName string, senderUserId string, senderProfileImage []byte, invites []string, siteURL string, reminderData *model.TeamInviteReminderData, message string, errorWhenNotSent bool) ([]*model.EmailInviteWithError, error) SendDeactivateAccountEmail(email string, locale, siteURL string) error SendNotificationMail(to, subject, htmlBody string) error SendMailWithEmbeddedFiles(to, subject, htmlBody string, embeddedFiles map[string]io.Reader) error SendLicenseUpForRenewalEmail(email, name, locale, siteURL, renewalLink string, daysToExpiration int) error SendPaymentFailedEmail(email string, locale string, failedPayment *model.FailedPayment, siteURL string) (bool, error) SendNoCardPaymentFailedEmail(email string, locale string, siteURL string) error SendRemoveExpiredLicenseEmail(renewalLink, email string, locale, siteURL string) error AddNotificationEmailToBatch(user *model.User, post *model.Post, team *model.Team) *model.AppError GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string InitEmailBatching() SendChangeUsernameEmail(newUsername, email, locale, siteURL string) error CreateVerifyEmailToken(userID string, newEmail string) (*model.Token, error) SendLicenseInactivityEmail(email, name, locale, siteURL string) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.