email

package
v0.0.0-...-5e2b11a Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 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
}

Email consists of the basic components of an email note: only one of `To`/`CC`/`BCC` needed to send an email ex: you can send to only BCC recipients if desired

func NewEmail

func NewEmail() Email

NewEmail returns an empty email object

func (Email) WithBCCAddresses

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

WithBCCAddresses sets the `BCC` field on an email

func (Email) WithBody

func (e Email) WithBody(body string) Email

WithBody sets the content (body) of an email

func (Email) WithCCAddresses

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

WithCCAddresses sets the `CC` field on an email

func (Email) WithSubject

func (e Email) WithSubject(subject string) Email

WithSubject sets the Subject on an email

func (Email) WithToAddresses

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

WithToAddresses sets the `To` field on an email

type GRBReviewDiscussionGroupTaggedBody

type GRBReviewDiscussionGroupTaggedBody struct {
	SystemIntakeID           uuid.UUID
	UserName                 string
	GroupName                string
	RequestName              string
	DiscussionBoardType      string
	GRBReviewLink            string
	Role                     string
	DiscussionContent        template.HTML
	DiscussionLink           string
	ClientAddress            string
	ITGovernanceInboxAddress models.EmailAddress
	IsAdmin                  bool
}

GRBReviewDiscussionGroupTaggedBody contains the data needed for interpolation in the GRB Discussion Group Tagged email template

type GRBReviewDiscussionIndividualTaggedBody

type GRBReviewDiscussionIndividualTaggedBody struct {
	SystemIntakeID           uuid.UUID
	UserName                 string
	RequestName              string
	DiscussionBoardType      string
	GRBReviewLink            string
	Role                     string
	DiscussionContent        template.HTML
	DiscussionLink           string
	ITGovernanceInboxAddress models.EmailAddress
	IsAdmin                  bool
}

GRBReviewDiscussionIndividualTaggedBody contains the data needed for interpolation in the GRB Discussion Individual Tagged email template

type GRBReviewDiscussionReplyBody

type GRBReviewDiscussionReplyBody struct {
	UserName                 string
	RequestName              string
	DiscussionBoardType      string
	GRBReviewLink            string
	Role                     string
	DiscussionContent        template.HTML
	DiscussionLink           string
	ITGovernanceInboxAddress models.EmailAddress
	IsAdmin                  bool
}

GRBReviewDiscussionReplyBody contains the data needed for interpolation in the TRB advice letter submitted email template

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 SendGRBReviewDiscussionGroupTaggedEmailInput

type SendGRBReviewDiscussionGroupTaggedEmailInput struct {
	SystemIntakeID    uuid.UUID
	UserName          string
	GroupName         string
	RequestName       string
	Role              string
	DiscussionContent template.HTML
	DiscussionID      uuid.UUID
	Recipients        models.EmailNotificationRecipients
}

SendGRBReviewDiscussionGroupTaggedEmailInput contains the data needed to send an email informing a group they have been tagged in a GRB discussion

type SendGRBReviewDiscussionIndividualTaggedEmailInput

type SendGRBReviewDiscussionIndividualTaggedEmailInput struct {
	SystemIntakeID    uuid.UUID
	UserName          string
	RequestName       string
	Role              string
	DiscussionID      uuid.UUID
	DiscussionContent template.HTML
	Recipients        []models.EmailAddress
}

SendGRBReviewDiscussionIndividualTaggedEmailInput contains the data needed to to send an email informing an individual they have been tagged in a GRB discussion

type SendGRBReviewDiscussionReplyEmailInput

type SendGRBReviewDiscussionReplyEmailInput struct {
	SystemIntakeID    uuid.UUID
	UserName          string
	RequestName       string
	Role              string
	DiscussionID      uuid.UUID
	DiscussionContent template.HTML
	Recipient         models.EmailAddress
}

SendGRBReviewDiscussionReplyEmailInput contains the data needed to send the GRB discussion reply email

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