Documentation ¶
Index ¶
- Constants
- Variables
- func GetSysAdminEmail(sender NotificationSender) (email string)
- type ClientCertModified
- func NewClientCertCreated(sysAdminEmail string, modifiedClientCertID uuid.UUID, modifiedAt time.Time, ...) (*ClientCertModified, error)
- func NewClientCertRemoved(sysAdminEmail string, modifiedClientCertID uuid.UUID, modifiedAt time.Time, ...) (*ClientCertModified, error)
- func NewClientCertUpdated(_ appcontext.AppContext, sysAdminEmail string, modifiedClientCertID uuid.UUID, ...) (*ClientCertModified, error)
- type LoggerData
- type MoveApproved
- type MoveCanceled
- type MoveCounseled
- type MoveCounseledEmailData
- type MoveIssuedToPrime
- type MoveSubmitted
- type Notification
- type NotificationSender
- type NotificationSendingContext
- type OfficeAccountRejected
- type PaymentReminder
- func (m PaymentReminder) GetEmailInfo(appCtx appcontext.AppContext) (PaymentReminderEmailInfos, error)
- func (m PaymentReminder) OnSuccess(appCtx appcontext.AppContext, ...) func(string) error
- func (m PaymentReminder) RenderHTML(appCtx appcontext.AppContext, data PaymentReminderEmailData) (string, error)
- func (m PaymentReminder) RenderText(appCtx appcontext.AppContext, data PaymentReminderEmailData) (string, error)
- type PaymentReminderEmailData
- type PaymentReminderEmailInfo
- type PaymentReminderEmailInfos
- type PpmPacketEmail
- func (p PpmPacketEmail) GetEmailData(appCtx appcontext.AppContext) (PpmPacketEmailData, LoggerData, error)
- func (p PpmPacketEmail) RenderHTML(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, error)
- func (p PpmPacketEmail) RenderText(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, error)
- type PpmPacketEmailData
- type PrimeCounselingComplete
- func (p PrimeCounselingComplete) GetEmailData(m primemessages.MoveTaskOrder, appCtx appcontext.AppContext) (PrimeCounselingCompleteData, error)
- func (p PrimeCounselingComplete) RenderHTML(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error)
- func (p PrimeCounselingComplete) RenderText(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error)
- type PrimeCounselingCompleteData
- type RawEmailSender
- type ReweighRequested
- type StubNotificationSender
- type UserAccountModified
- func NewUserAccountActivated(appCtx appcontext.AppContext, sysAdminEmail string, modifiedUserID uuid.UUID, ...) (*UserAccountModified, error)
- func NewUserAccountCreated(appCtx appcontext.AppContext, sysAdminEmail string, modifiedUserID uuid.UUID, ...) (*UserAccountModified, error)
- func NewUserAccountDeactivated(appCtx appcontext.AppContext, sysAdminEmail string, modifiedUserID uuid.UUID, ...) (*UserAccountModified, error)
- func NewUserAccountRemoved(appCtx appcontext.AppContext, sysAdminEmail string, modifiedUserID uuid.UUID, ...) (*UserAccountModified, error)
Constants ¶
const MyMoveLink = "https://my.move.mil/"
const OneSourceTransportationOfficeLink = "https://installations.militaryonesource.mil/search?program-service=2/view-by=ALL"
const WashingtonHQServicesLink = "https://www.esd.whs.mil"
Variables ¶
var ( PrimeCounselingCompleteRawText = string(assets.MustAsset("notifications/templates/prime_counseling_complete_template.txt")) PrimeCounselingCompleteTextTemplate = text.Must(text.New("text_template").Parse(PrimeCounselingCompleteRawText)) PrimeCounselingCompleteRawHTML = string(assets.MustAsset("notifications/templates/prime_counseling_complete_template.html")) PrimeCounselingCompleteHTMLTemplate = html.Must(html.New("text_template").Parse(PrimeCounselingCompleteRawHTML)) )
Functions ¶
func GetSysAdminEmail ¶
func GetSysAdminEmail(sender NotificationSender) (email string)
GetSysAdminEmail returns the System Administrators' email address that has been set in the NotificationSender
Types ¶
type ClientCertModified ¶
type ClientCertModified struct {
// contains filtered or unexported fields
}
ClientCertModified has notification content for alerting admins when a user account has been modified
func NewClientCertCreated ¶
func NewClientCertCreated( sysAdminEmail string, modifiedClientCertID uuid.UUID, modifiedAt time.Time, responsibleUserID uuid.UUID, host string, ) (*ClientCertModified, error)
NewClientCertCreated returns a new ClientCertModified notification for account creation
func NewClientCertRemoved ¶
func NewClientCertRemoved( sysAdminEmail string, modifiedClientCertID uuid.UUID, modifiedAt time.Time, responsibleUserID uuid.UUID, host string, ) (*ClientCertModified, error)
NewClientCertRemoved returns a new ClientCertModified notification for account removal
func NewClientCertUpdated ¶
func NewClientCertUpdated( _ appcontext.AppContext, sysAdminEmail string, modifiedClientCertID uuid.UUID, modifiedAt time.Time, responsibleUserID uuid.UUID, host string, ) (*ClientCertModified, error)
NewClientCertUpdated returns a new ClientCertModified notification for cert modification
func (ClientCertModified) RenderHTML ¶
func (m ClientCertModified) RenderHTML(appCtx appcontext.AppContext, data clientCertModifiedEmailData) (string, error)
RenderHTML renders the html for the email
func (ClientCertModified) RenderText ¶
func (m ClientCertModified) RenderText(appCtx appcontext.AppContext, data clientCertModifiedEmailData) (string, error)
RenderText renders the text for the email
type LoggerData ¶
type LoggerData struct { ServiceMember models.ServiceMember PPMShipmentID uuid.UUID MoveLocator string }
Used to get logging data from GetEmailData
type MoveApproved ¶
type MoveApproved struct {
// contains filtered or unexported fields
}
MoveApproved has notification content for approved moves
func NewMoveApproved ¶
func NewMoveApproved( host string, moveID uuid.UUID) *MoveApproved
NewMoveApproved returns a new move approval notification
func (MoveApproved) RenderHTML ¶
func (m MoveApproved) RenderHTML(appCtx appcontext.AppContext, data moveApprovedEmailData) (string, error)
RenderHTML renders the html for the email
func (MoveApproved) RenderText ¶
func (m MoveApproved) RenderText(appCtx appcontext.AppContext, data moveApprovedEmailData) (string, error)
RenderText renders the text for the email
type MoveCanceled ¶
type MoveCanceled struct {
// contains filtered or unexported fields
}
MoveCanceled has notification content for approved moves
func NewMoveCanceled ¶
func NewMoveCanceled(moveID uuid.UUID) *MoveCanceled
NewMoveCanceled returns a new move approval notification
func (MoveCanceled) RenderHTML ¶
func (m MoveCanceled) RenderHTML(appCtx appcontext.AppContext, data moveCanceledEmailData) (string, error)
RenderHTML renders the html for the email
func (MoveCanceled) RenderText ¶
func (m MoveCanceled) RenderText(appCtx appcontext.AppContext, data moveCanceledEmailData) (string, error)
RenderText renders the text for the email
type MoveCounseled ¶
type MoveCounseled struct {
// contains filtered or unexported fields
}
MoveCounseled has notification content for counseled moves (before TOO approval)
func NewMoveCounseled ¶
func NewMoveCounseled(moveID uuid.UUID) *MoveCounseled
NewMoveCounseled returns a new move counseled notification (before TOO approval)
func (MoveCounseled) RenderHTML ¶
func (m MoveCounseled) RenderHTML(appCtx appcontext.AppContext, data MoveCounseledEmailData) (string, error)
RenderHTML renders the html for the email
func (MoveCounseled) RenderText ¶
func (m MoveCounseled) RenderText(appCtx appcontext.AppContext, data MoveCounseledEmailData) (string, error)
RenderText renders the text for the email
type MoveCounseledEmailData ¶
type MoveIssuedToPrime ¶
type MoveIssuedToPrime struct {
// contains filtered or unexported fields
}
MoveIssuedToPrime has notification content for submitted moves
func NewMoveIssuedToPrime ¶
func NewMoveIssuedToPrime(moveID uuid.UUID) *MoveIssuedToPrime
NewMoveIssuedToPrime returns a new move submitted notification
func (MoveIssuedToPrime) RenderHTML ¶
func (m MoveIssuedToPrime) RenderHTML(appCtx appcontext.AppContext, data moveIssuedToPrimeEmailData) (string, error)
RenderHTML renders the html for the email
func (MoveIssuedToPrime) RenderText ¶
func (m MoveIssuedToPrime) RenderText(appCtx appcontext.AppContext, data moveIssuedToPrimeEmailData) (string, error)
RenderText renders the text for the email
type MoveSubmitted ¶
type MoveSubmitted struct {
// contains filtered or unexported fields
}
MoveSubmitted has notification content for submitted moves
func NewMoveSubmitted ¶
func NewMoveSubmitted(moveID uuid.UUID) *MoveSubmitted
NewMoveSubmitted returns a new move submitted notification
func (MoveSubmitted) RenderHTML ¶
func (m MoveSubmitted) RenderHTML(appCtx appcontext.AppContext, data moveSubmittedEmailData) (string, error)
RenderHTML renders the html for the email
func (MoveSubmitted) RenderText ¶
func (m MoveSubmitted) RenderText(appCtx appcontext.AppContext, data moveSubmittedEmailData) (string, error)
RenderText renders the text for the email
type Notification ¶
type Notification interface {
// contains filtered or unexported methods
}
Notification is an interface for creating emails
type NotificationSender ¶
type NotificationSender interface {
SendNotification(appCtx appcontext.AppContext, notification Notification) error
}
NotificationSender is an interface for sending notifications
type NotificationSendingContext ¶
type NotificationSendingContext struct {
// contains filtered or unexported fields
}
NotificationSendingContext provides context to a notification sender
func NewNotificationSender ¶
func NewNotificationSender(svc RawEmailSender, domain string, sysAdminEmail string) NotificationSendingContext
NewNotificationSender returns a new NotificationSendingContext
func (NotificationSendingContext) SendNotification ¶
func (n NotificationSendingContext) SendNotification(appCtx appcontext.AppContext, notification Notification) error
SendNotification sends a one or more notifications for all supported mediums
type OfficeAccountRejected ¶
type OfficeAccountRejected struct {
// contains filtered or unexported fields
}
OfficeAccountRejected has notification content for rejected office users
func NewOfficeAccountRejected ¶
func NewOfficeAccountRejected(officeUserID uuid.UUID) *OfficeAccountRejected
NewOfficeAccountRejected returns a new office user rejected notification
func (OfficeAccountRejected) RenderHTML ¶
func (o OfficeAccountRejected) RenderHTML(appCtx appcontext.AppContext, data officeAccountRejectedEmailData) (string, error)
RenderHTML renders the html for the email
func (OfficeAccountRejected) RenderText ¶
func (o OfficeAccountRejected) RenderText(appCtx appcontext.AppContext, data officeAccountRejectedEmailData) (string, error)
RenderText renders the text for the email
type PaymentReminder ¶
type PaymentReminder struct {
// contains filtered or unexported fields
}
PaymentReminder has notification content for approved moves
func NewPaymentReminder ¶
func NewPaymentReminder() (*PaymentReminder, error)
NewPaymentReminder returns a new payment reminder notification 14 days after actual move in date
func (PaymentReminder) GetEmailInfo ¶
func (m PaymentReminder) GetEmailInfo(appCtx appcontext.AppContext) (PaymentReminderEmailInfos, error)
GetEmailInfo fetches payment email information left joins on duty locations to allow for those fields to be null
func (PaymentReminder) OnSuccess ¶
func (m PaymentReminder) OnSuccess(appCtx appcontext.AppContext, PaymentReminderEmailInfo PaymentReminderEmailInfo) func(string) error
OnSuccess callback passed to be invoked by NewNotificationSender when an email successfully sent saves the svs the email info along with the SES mail id to the notifications table
func (PaymentReminder) RenderHTML ¶
func (m PaymentReminder) RenderHTML(appCtx appcontext.AppContext, data PaymentReminderEmailData) (string, error)
RenderHTML renders the html for the email
func (PaymentReminder) RenderText ¶
func (m PaymentReminder) RenderText(appCtx appcontext.AppContext, data PaymentReminderEmailData) (string, error)
RenderText renders the text for the email
type PaymentReminderEmailData ¶
type PaymentReminderEmailData struct { OriginDutyLocation string DestinationDutyLocation string Locator string OneSourceLink string MyMoveLink string }
PaymentReminderEmailData is used to render an email template
type PaymentReminderEmailInfo ¶
type PaymentReminderEmailInfo struct { ServiceMemberID uuid.UUID `db:"id"` Email *string `db:"personal_email"` NewDutyLocationName string `db:"new_duty_location_name"` OriginDutyLocationName string `db:"origin_duty_location_name"` MoveDate string `db:"move_date"` Locator string `db:"locator"` WeightEstimate *unit.Pound `db:"weight_estimate"` IncentiveEstimate *unit.Cents `db:"incentive_estimate"` }
PaymentReminderEmailInfo contains payment reminder data for rendering a template
type PaymentReminderEmailInfos ¶
type PaymentReminderEmailInfos []PaymentReminderEmailInfo
PaymentReminderEmailInfos is a slice of PaymentReminderEmailInfo
type PpmPacketEmail ¶
type PpmPacketEmail struct {
// contains filtered or unexported fields
}
PpmPacketEmail has notification content for approved moves
func NewPpmPacketEmail ¶
func NewPpmPacketEmail(ppmShipmentID uuid.UUID) *PpmPacketEmail
NewPpmPacketEmail returns a new payment reminder notification 14 days after actual move in date
func (PpmPacketEmail) GetEmailData ¶
func (p PpmPacketEmail) GetEmailData(appCtx appcontext.AppContext) (PpmPacketEmailData, LoggerData, error)
func (PpmPacketEmail) RenderHTML ¶
func (p PpmPacketEmail) RenderHTML(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, error)
RenderHTML renders the html for the email
func (PpmPacketEmail) RenderText ¶
func (p PpmPacketEmail) RenderText(appCtx appcontext.AppContext, data PpmPacketEmailData) (string, error)
RenderText renders the text for the email
type PpmPacketEmailData ¶
type PpmPacketEmailData struct { OriginZIP *string OriginCity *string OriginState *string DestinationZIP *string DestinationCity *string DestinationState *string SubmitLocation string ServiceBranch string Locator string OneSourceTransportationOfficeLink string WashingtonHQServicesLink string MyMoveLink string }
ppmPacketEmailData is used to render an email template Uses ZIPs only if no city/state data is provided
type PrimeCounselingComplete ¶
type PrimeCounselingComplete struct {
// contains filtered or unexported fields
}
PrimeCounselingComplete has notification content for moves that have had their counseling completed by the Prime
func NewPrimeCounselingComplete ¶
func NewPrimeCounselingComplete(moveTaskOrder primemessages.MoveTaskOrder) *PrimeCounselingComplete
NewPrimeCounselingComplete returns a new payment reminder notification 14 days after actual move in date
func (PrimeCounselingComplete) GetEmailData ¶
func (p PrimeCounselingComplete) GetEmailData(m primemessages.MoveTaskOrder, appCtx appcontext.AppContext) (PrimeCounselingCompleteData, error)
func (PrimeCounselingComplete) RenderHTML ¶
func (p PrimeCounselingComplete) RenderHTML(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error)
RenderHTML renders the html for the email
func (PrimeCounselingComplete) RenderText ¶
func (p PrimeCounselingComplete) RenderText(appCtx appcontext.AppContext, data PrimeCounselingCompleteData) (string, error)
RenderText renders the text for the email
type PrimeCounselingCompleteData ¶
type PrimeCounselingCompleteData struct { CustomerEmail string OriginDutyLocation string DestinationDutyLocation string Locator string OneSourceTransportationOfficeLink string MyMoveLink string }
PrimeCounselingCompleteData is used to render an email template
type RawEmailSender ¶
type RawEmailSender interface {
SendRawEmail(ctx context.Context, params *ses.SendRawEmailInput, optFns ...func(*ses.Options)) (*ses.SendRawEmailOutput, error)
}
type ReweighRequested ¶
type ReweighRequested struct {
// contains filtered or unexported fields
}
ReweighRequested has notification content for submitted moves
func NewReweighRequested ¶
func NewReweighRequested(moveID uuid.UUID, shipment models.MTOShipment) *ReweighRequested
NewReweighRequested returns a new move submitted notification
func (ReweighRequested) RenderHTML ¶
func (m ReweighRequested) RenderHTML(appCtx appcontext.AppContext, data reweighRequestedEmailData) (string, error)
RenderHTML renders the html for the email
func (ReweighRequested) RenderText ¶
func (m ReweighRequested) RenderText(appCtx appcontext.AppContext, data reweighRequestedEmailData) (string, error)
RenderText renders the text for the email
type StubNotificationSender ¶
type StubNotificationSender NotificationSendingContext
StubNotificationSender mocks an SES client for local usage
func NewStubNotificationSender ¶
func NewStubNotificationSender(domain string) StubNotificationSender
NewStubNotificationSender returns a new StubNotificationSender
func (StubNotificationSender) SendNotification ¶
func (m StubNotificationSender) SendNotification(appCtx appcontext.AppContext, notification Notification) error
SendNotification returns a dummy ID
type UserAccountModified ¶
type UserAccountModified struct {
// contains filtered or unexported fields
}
UserAccountModified has notification content for alerting admins when a user account has been modified
func NewUserAccountActivated ¶
func NewUserAccountActivated( appCtx appcontext.AppContext, sysAdminEmail string, modifiedUserID uuid.UUID, modifiedAt time.Time, ) (*UserAccountModified, error)
NewUserAccountActivated returns a new UserAccountModified notification for account activation
func NewUserAccountCreated ¶
func NewUserAccountCreated( appCtx appcontext.AppContext, sysAdminEmail string, modifiedUserID uuid.UUID, modifiedAt time.Time, ) (*UserAccountModified, error)
NewUserAccountCreated returns a new UserAccountModified notification for account creation
func NewUserAccountDeactivated ¶
func NewUserAccountDeactivated( appCtx appcontext.AppContext, sysAdminEmail string, modifiedUserID uuid.UUID, modifiedAt time.Time, ) (*UserAccountModified, error)
NewUserAccountDeactivated returns a new UserAccountModified notification for account deactivation
func NewUserAccountRemoved ¶
func NewUserAccountRemoved( appCtx appcontext.AppContext, sysAdminEmail string, modifiedUserID uuid.UUID, modifiedAt time.Time, ) (*UserAccountModified, error)
NewUserAccountRemoved returns a new UserAccountModified notification for account removal
func (UserAccountModified) RenderHTML ¶
func (m UserAccountModified) RenderHTML(appCtx appcontext.AppContext, data userAccountModifiedEmailData) (string, error)
RenderHTML renders the html for the email
func (UserAccountModified) RenderText ¶
func (m UserAccountModified) RenderText(appCtx appcontext.AppContext, data userAccountModifiedEmailData) (string, error)
RenderText renders the text for the email
Source Files ¶
- client_cert_modified.go
- constants.go
- move_approved.go
- move_canceled.go
- move_counseled.go
- move_issued_to_prime.go
- move_payment_reminder.go
- move_submitted.go
- notification_sender.go
- notification_stub.go
- office_account_rejected.go
- ppm_packet_email.go
- prime_counseling_complete.go
- reweigh_requested.go
- user_account_modified.go