email

package
v0.0.0-...-64a628e Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNonProdEnvToSubject

func AddNonProdEnvToSubject(subject string, env appconfig.Environment) string

AddNonProdEnvToSubject takes a subject and an environment and returns a new subject with the environment prepended if (and only if) the environment is non-production Otherwise, it returns the original subject

func HumanizeSnakeCase

func HumanizeSnakeCase(s string) string

HumanizeSnakeCase replaces underscores with spaces and converts an uppercased word to a capitalized one

Types

type Client

type Client struct {
	SystemIntake *systemIntakeEmails
	// contains filtered or unexported fields
}

Client is an EASi SES client wrapper

func NewClient

func NewClient(config Config, sender sender) (Client, error)

NewClient returns a new email client for EASi

func (Client) SendCantFindSomethingEmail

func (c Client) SendCantFindSomethingEmail(ctx context.Context, input SendCantFindSomethingEmailInput) error

SendCantFindSomethingEmail sends an email to the EASI team containing a user's request for help

func (Client) SendCedarNewTeamMemberEmail

func (c Client) SendCedarNewTeamMemberEmail(
	ctx context.Context,
	newTeamMemberName string,
	newTeamMemberEmail string,
	systemName string,
	systemID string,
	roles []string,
	existingTeamMembers []*models.CedarRole,
) error

func (Client) SendCedarRolesChangedEmail

func (c Client) SendCedarRolesChangedEmail(
	ctx context.Context,
	requesterFullName string,
	targetFullName string,
	didAdd bool,
	didDelete bool,
	roleTypeNamesBefore []string,
	roleTypeNamesAfter []string,
	systemName string,
	timestamp time.Time,
) error

SendCedarRolesChangedEmail notifies someone that they've been added as an attendee on a TRB request

func (Client) SendCedarYouHaveBeenAddedEmail

func (c Client) SendCedarYouHaveBeenAddedEmail(
	ctx context.Context,
	systemName string,
	systemID string,
	roles []string,
	teamMemberEmail models.EmailAddress,
) error

func (Client) SendFeedbackEmail

func (c Client) SendFeedbackEmail(ctx context.Context, input SendFeedbackEmailInput) error

SendFeedbackEmail sends an email to the EASI team containing feedback from a user

func (Client) SendLCIDExpirationAlertEmail

func (c Client) SendLCIDExpirationAlertEmail(
	ctx context.Context,
	recipients models.EmailNotificationRecipients,
	systemIntakeID uuid.UUID,
	projectName string,
	requesterName string,
	lcid string,
	lcidIssuedAt *time.Time,
	lcidExpirationDate *time.Time,
	scope models.HTML,
	lifecycleCostBaseline string,
	nextSteps models.HTML,
) error

SendLCIDExpirationAlertEmail sends an email to the governance mailbox notifying them about LCID that is expiring soon

func (Client) SendReportAProblemEmail

func (c Client) SendReportAProblemEmail(ctx context.Context, input SendReportAProblemEmailInput) error

SendReportAProblemEmail sends an email to the EASI team containing a user's request for help

func (Client) SendTRBAttendeeAddedNotification

func (c Client) SendTRBAttendeeAddedNotification(
	ctx context.Context,
	attendeeEmail models.EmailAddress,
	requestName string,
	requesterName string,
) error

SendTRBAttendeeAddedNotification notifies someone that they've been added as an attendee on a TRB request

func (Client) SendTRBEditsNeededOnFormNotification

func (c Client) SendTRBEditsNeededOnFormNotification(
	ctx context.Context,
	recipients []models.EmailAddress,
	copyTRBMailbox bool,
	requestID uuid.UUID,
	requestName string,
	requesterName string,
	feedback models.HTML,
) error

SendTRBEditsNeededOnFormNotification notifies user-selected recipients that a TRB request form needs edits

func (Client) SendTRBFormSubmissionNotificationToAdmins

func (c Client) SendTRBFormSubmissionNotificationToAdmins(ctx context.Context, requestID uuid.UUID, requestName string, requesterName string, component string) error

SendTRBFormSubmissionNotificationToAdmins notifies the TRB admin mailbox that a TRB Request form has been submitted

func (Client) SendTRBFormSubmissionNotificationToRequester

func (c Client) SendTRBFormSubmissionNotificationToRequester(
	ctx context.Context,
	requestID uuid.UUID,
	requestName string,
	requesterEmail models.EmailAddress,
	requesterName string,
) error

SendTRBFormSubmissionNotificationToRequester notifies a TRB requester that their TRB Request form has been submitted

func (Client) SendTRBGuidanceLetterInternalReviewEmail

func (c Client) SendTRBGuidanceLetterInternalReviewEmail(ctx context.Context, input SendTRBGuidanceLetterInternalReviewEmailInput) error

SendTRBGuidanceLetterInternalReviewEmail sends an email to the EASI admin team indicating that a guidance letter is ready for internal review

func (Client) SendTRBGuidanceLetterSubmittedEmail

func (c Client) SendTRBGuidanceLetterSubmittedEmail(ctx context.Context, input SendTRBGuidanceLetterSubmittedEmailInput) error

SendTRBGuidanceLetterSubmittedEmail sends an email to the EASI admin team indicating that a guidance letter has been submitted

func (Client) SendTRBReadyForConsultNotification

func (c Client) SendTRBReadyForConsultNotification(
	ctx context.Context,
	recipients []models.EmailAddress,
	copyTRBMailbox bool,
	requestID uuid.UUID,
	requestName string,
	requesterName string,
	feedback models.HTML,
) error

SendTRBReadyForConsultNotification notifies user-selected recipients that a TRB request is ready for its consult session

func (Client) SendTRBRequestClosedEmail

func (c Client) SendTRBRequestClosedEmail(ctx context.Context, input SendTRBRequestClosedEmailInput) error

SendTRBRequestClosedEmail sends an email to the EASI admin team indicating that a TRB request has been closed

func (Client) SendTRBRequestConsultMeetingEmail

func (c Client) SendTRBRequestConsultMeetingEmail(ctx context.Context, input SendTRBRequestConsultMeetingEmailInput) error

SendTRBRequestConsultMeetingEmail sends an email to the EASI team containing a user's request for help

func (Client) SendTRBRequestReopenedEmail

func (c Client) SendTRBRequestReopenedEmail(ctx context.Context, input SendTRBRequestReopenedEmailInput) error

SendTRBRequestReopenedEmail sends an email to the EASI admin team indicating that a TRB request has been re-opened

func (Client) SendTRBRequestTRBLeadAssignedEmails

func (c Client) SendTRBRequestTRBLeadAssignedEmails(ctx context.Context, input SendTRBRequestTRBLeadEmailInput) error

SendTRBRequestTRBLeadAssignedEmails sends emails to the TRB team and the TRB lead when the lead is assigned to a TRB request

func (Client) SendTestEmail

func (c Client) SendTestEmail(ctx context.Context) error

SendTestEmail sends an email to a no-reply address

func (Client) SendWithdrawRequestEmail

func (c Client) SendWithdrawRequestEmail(ctx context.Context, requestName string) error

SendWithdrawRequestEmail sends an email for a submitted system intake

type Config

type Config struct {
	GRTEmail                    models.EmailAddress
	ITInvestmentEmail           models.EmailAddress
	EASIHelpEmail               models.EmailAddress
	TRBEmail                    models.EmailAddress
	CEDARTeamEmail              models.EmailAddress
	OITFeedbackChannelSlackLink string
	URLHost                     string
	URLScheme                   string
	TemplateDirectory           string
}

Config holds EASi application specific configs for SES

type Email

type Email struct {
	ToAddresses  []models.EmailAddress
	CcAddresses  []models.EmailAddress
	BccAddresses []models.EmailAddress
	Subject      string
	Body         string
}

func NewEmail

func NewEmail() Email

func (Email) WithBCCAddresses

func (e Email) WithBCCAddresses(bccAddresses []models.EmailAddress) Email

func (Email) WithBody

func (e Email) WithBody(body string) Email

func (Email) WithCCAddresses

func (e Email) WithCCAddresses(ccAddresses []models.EmailAddress) Email

func (Email) WithSubject

func (e Email) WithSubject(subject string) Email

func (Email) WithToAddresses

func (e Email) WithToAddresses(toAddresses []models.EmailAddress) Email

type SendCantFindSomethingEmailInput

type SendCantFindSomethingEmailInput struct {
	Name  string
	Email string
	Body  string
}

SendCantFindSomethingEmailInput contains the data submitted by the user to the "can't find find what you're looking for" help form

type SendFeedbackEmailInput

type SendFeedbackEmailInput struct {
	IsAnonymous            bool
	ReporterName           string
	ReporterEmail          string
	CanBeContacted         bool
	EasiServicesUsed       []string
	CmsRole                string
	SystemEasyToUse        string
	DidntNeedHelpAnswering string
	QuestionsWereRelevant  string
	HadAccessToInformation string
	HowSatisfied           string
	HowCanWeImprove        string
}

SendFeedbackEmailInput contains the data submitted by the user to send feedback

type SendReportAProblemEmailInput

type SendReportAProblemEmailInput struct {
	IsAnonymous            bool
	ReporterName           string
	ReporterEmail          string
	CanBeContacted         bool
	EasiService            string
	WhatWereYouDoing       string
	WhatWentWrong          string
	HowSevereWasTheProblem string
}

SendReportAProblemEmailInput contains the data submitted by the user to the "report a problem" help form

type SendSystemIntakeAdminUploadDocEmailInput

type SendSystemIntakeAdminUploadDocEmailInput struct {
	SystemIntakeID     uuid.UUID
	RequestName        string
	RequesterName      string
	RequesterComponent string
	Recipients         []models.EmailAddress
}

type SendTRBGuidanceLetterInternalReviewEmailInput

type SendTRBGuidanceLetterInternalReviewEmailInput struct {
	TRBRequestID   uuid.UUID
	TRBRequestName string
	TRBLeadName    string
}

SendTRBGuidanceLetterInternalReviewEmailInput contains the data needed to to send the TRB guidance letter internal review email

type SendTRBGuidanceLetterSubmittedEmailInput

type SendTRBGuidanceLetterSubmittedEmailInput struct {
	TRBRequestID   uuid.UUID
	RequestName    string
	RequestType    string
	RequesterName  string
	Component      string
	SubmissionDate *time.Time
	ConsultDate    *time.Time
	CopyTRBMailbox bool
	Recipients     []models.EmailAddress
}

SendTRBGuidanceLetterSubmittedEmailInput contains the data needed to to send the TRB guidance letter submitted email

type SendTRBRequestClosedEmailInput

type SendTRBRequestClosedEmailInput struct {
	TRBRequestID   uuid.UUID
	TRBRequestName string
	RequesterName  string
	Recipients     []models.EmailAddress
	CopyTRBMailbox bool
	ReasonClosed   models.HTML
}

SendTRBRequestClosedEmailInput contains the data needed to to send the TRB request closed email

type SendTRBRequestConsultMeetingEmailInput

type SendTRBRequestConsultMeetingEmailInput struct {
	TRBRequestID       uuid.UUID
	ConsultMeetingTime time.Time
	CopyTRBMailbox     bool
	NotifyEmails       []models.EmailAddress
	TRBRequestName     string
	Notes              string
	RequesterName      string
}

SendTRBRequestConsultMeetingEmailInput contains the data submitted by the user to the "report a problem" help form

type SendTRBRequestReopenedEmailInput

type SendTRBRequestReopenedEmailInput struct {
	TRBRequestID   uuid.UUID
	TRBRequestName string
	RequesterName  string
	Recipients     []models.EmailAddress
	CopyTRBMailbox bool
	ReasonReopened models.HTML
}

SendTRBRequestReopenedEmailInput contains the data needed to send the TRB guidance letter submitted email

type SendTRBRequestTRBLeadEmailInput

type SendTRBRequestTRBLeadEmailInput struct {
	TRBRequestID   uuid.UUID
	TRBRequestName string
	RequesterName  string
	TRBLeadName    string
	Component      string
	TRBLeadEmail   models.EmailAddress
}

SendTRBRequestTRBLeadEmailInput contains the data needed to send an email to the TRB team indicating that a TRB lead has been assigned

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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