-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12148 from transcom/B-19035-Update-Payment-Remind…
…er-Email-Template B 19035 update payment reminder email template
- Loading branch information
Showing
7 changed files
with
501 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"strings" | ||
|
||
"github.com/pkg/errors" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/pflag" | ||
"github.com/spf13/viper" | ||
"go.uber.org/zap" | ||
|
||
"github.com/transcom/mymove/pkg/appcontext" | ||
"github.com/transcom/mymove/pkg/cli" | ||
"github.com/transcom/mymove/pkg/logging" | ||
"github.com/transcom/mymove/pkg/notifications" | ||
) | ||
|
||
func checkPaymentReminderConfig(v *viper.Viper, logger *zap.Logger) error { | ||
|
||
logger.Debug("checking config") | ||
|
||
err := cli.CheckDatabase(v, logger) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return cli.CheckEmail(v) | ||
} | ||
|
||
func initPaymentReminderFlags(flag *pflag.FlagSet) { | ||
|
||
// DB Config | ||
cli.InitDatabaseFlags(flag) | ||
|
||
// Logging Levels | ||
cli.InitLoggingFlags(flag) | ||
|
||
cli.InitEmailFlags(flag) | ||
|
||
// Don't sort flags | ||
flag.SortFlags = false | ||
} | ||
|
||
// Command (test eamil): go run ./cmd/milmove-tasks send-payment-reminder | ||
// Command (send email): go run ./cmd/milmove-tasks send-payment-reminder --email-backend=ses --aws-ses-domain=devlocal.dp3.us --aws-ses-region=us-gov-west-1 | ||
func sendPaymentReminder(cmd *cobra.Command, args []string) error { | ||
err := cmd.ParseFlags(args) | ||
if err != nil { | ||
return errors.Wrap(err, "Could not parse args") | ||
} | ||
flags := cmd.Flags() | ||
v := viper.New() | ||
err = v.BindPFlags(flags) | ||
if err != nil { | ||
return errors.Wrap(err, "Could not bind flags") | ||
} | ||
v.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) | ||
v.AutomaticEnv() | ||
|
||
dbEnv := v.GetString(cli.DbEnvFlag) | ||
|
||
logger, _, err := logging.Config( | ||
logging.WithEnvironment(dbEnv), | ||
logging.WithLoggingLevel(v.GetString(cli.LoggingLevelFlag)), | ||
logging.WithStacktraceLength(v.GetInt(cli.StacktraceLengthFlag)), | ||
) | ||
if err != nil { | ||
log.Fatalf("Failed to initialize Zap logging due to %v", err) | ||
} | ||
zap.ReplaceGlobals(logger) | ||
|
||
err = checkPaymentReminderConfig(v, logger) | ||
if err != nil { | ||
logger.Fatal("invalid configuration", zap.Error(err)) | ||
} | ||
|
||
// Create a connection to the DB | ||
dbConnection, err := cli.InitDatabase(v, logger) | ||
if err != nil { | ||
logger.Fatal("Connecting to DB", zap.Error(err)) | ||
} | ||
|
||
appCtx := appcontext.NewAppContext(dbConnection, logger, nil) | ||
|
||
notificationSender, notificationSenderErr := notifications.InitEmail(v, logger) | ||
if notificationSenderErr != nil { | ||
logger.Fatal("notification sender sending not enabled", zap.Error(notificationSenderErr)) | ||
} | ||
|
||
movePaymentReminderNotifier, err := notifications.NewPaymentReminder() | ||
if err != nil { | ||
logger.Fatal("initializing MoveReviewed", zap.Error(err)) | ||
} | ||
|
||
err = notificationSender.SendNotification(appCtx, movePaymentReminderNotifier) | ||
if err != nil { | ||
logger.Fatal("Emails failed to send", zap.Error(err)) | ||
} | ||
return nil | ||
} |
51 changes: 23 additions & 28 deletions
51
pkg/assets/notifications/templates/move_payment_reminder_template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,39 @@ | ||
<p>We hope your move to {{.DestinationDutyLocation}} went well.</p> | ||
<p><strong>***</strong> DO NOT REPLY directly to this email <strong>***</strong></p> | ||
|
||
<p>It’s been a couple of weeks, so we want to make sure you get paid for that move. {{.IncentiveTxt}}</p> | ||
<p>This is a reminder that your PPM with the <strong>assigned move code {{.Locator}}</strong> from | ||
<strong>{{.OriginDutyLocation}}</strong> to <strong>{{.DestinationDutyLocation}}</strong> is awaiting action in MilMove.</p> | ||
|
||
<p>To get your incentive, you need to request payment.</p> | ||
<p>Next steps:</p> | ||
|
||
<p>Log in to MilMove and request payment</p> | ||
<p>To get your payment, you need to login to MilMove, document expenses, and request payment.</p> | ||
|
||
<p>We want to pay you for your PPM, but we can’t do that until you document expenses and request payment.</p> | ||
|
||
<p>To do that</p> | ||
<p>To do that:</p> | ||
|
||
<p> | ||
<ul> | ||
<li><a href="{{.MyMoveLink}}">Log in to MilMove</a></li> | ||
<li>Click Request Payment</li> | ||
<li>Follow the instructions.</li> | ||
<li>Log into <a href={{.MyMoveLink}}>MilMove</a></li> | ||
<li>Click on "Upload PPM Documents"</li> | ||
<li>Follow the instructions</li> | ||
</ul> | ||
|
||
<p>What documents do you need?</p> | ||
</p> | ||
|
||
<p>To request payment, you should have copies of:</p> | ||
|
||
<ul> | ||
<li>Weight tickets from certified scales, documenting empty and full weights for all vehicles and trailers you used for your move</li> | ||
<li>Receipts for reimbursable expenses (see our moving tips PDF for more info)</li> | ||
<li> Weight tickets from certified scales, documenting empty and full weights for all vehicles and trailers you used for your move.</li> | ||
<li> Receipts for reimbursable expenses.</li> | ||
</ul> | ||
|
||
<p>MilMove will ask you to upload copies of your documents as you complete your payment request.</p> | ||
|
||
<p>What if you’re missing documents?</p> | ||
|
||
<p>If you’re missing receipts, you can still request payment. You might not get reimbursement or a tax credit for those expenses.</p> | ||
{{ if .TOName }} | ||
<p>If you’re missing certified weight tickets, your PPPO will have to help. Call {{.TOName}}{{if .TOPhone}} at {{.TOPhone}}{{end}} to have them walk you through it. Reference your move locator code: {{.Locator}}.</p> | ||
{{- end -}} | ||
<p>MilMove will ask you to upload copies of your documents as you complete your payment request. | ||
|
||
{{ if not .TOName }} | ||
<p>If you are missing weight tickets, someone from the government will have to help. Consult Military OneSource's <a href="https://www.militaryonesource.mil/moving-housing/moving/planning-your-move/customer-service-contacts-for-military-pcs/">directory of PCS-related contacts</a> to find your best contact and reference your move code {{.Locator}}.</p> | ||
{{- end }} | ||
<p>If you are missing reciepts, you may still be able to request payment, but you will need assistance from your transportation office.</p> | ||
|
||
<p>Log in to MilMove to complete your request and get paid.</p> | ||
<p>Payment request must be submitted within 45 days of your move date.</p> | ||
|
||
<p>Request payment within 45 days of your move date or you might not be able to get paid.</p> | ||
<p>If you have any questions, contact a government transportation office. You can see a listing of | ||
transportation offices on Military OneSource here: <<a href="{{.OneSourceLink}}">{{.OneSourceLink}}</a>></p> | ||
|
||
{{if .TOName}}<p>If you have any questions or concerns, you can talk to a human! Call your local PPPO at {{.TOName}}{{if .TOPhone}} at {{.TOPhone}}{{end}}. Reference your move locator code: {{.Locator}}.</p>{{end}} | ||
<p>Thank you,</p> | ||
<p>USTRANSCOM MilMove Team</p> | ||
<p>The information contained in this email may contain Privacy Act information and is therefore protected | ||
under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.</p> |
39 changes: 19 additions & 20 deletions
39
pkg/assets/notifications/templates/move_payment_reminder_template.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,34 @@ | ||
We hope your move to {{.DestinationDutyLocation}} went well. | ||
*** DO NOT REPLY directly to this email *** | ||
|
||
It’s been a couple of weeks, so we want to make sure you get paid for that move. {{.IncentiveTxt}} | ||
This is a reminder that your PPM with the assigned move code {{.Locator}} from {{.OriginDutyLocation}} | ||
to {{.DestinationDutyLocation}} is awaiting action in MilMove. | ||
|
||
To get your incentive, you need to request payment. | ||
Next steps: | ||
|
||
Log in to MilMove and request payment | ||
To get your payment, you need to login to MilMove, document expenses, and request payment. | ||
|
||
We want to pay you for your PPM, but we can’t do that until you document expenses and request payment. | ||
To do that: | ||
|
||
To do that | ||
|
||
* Log in to MilMove | ||
* Click Request Payment | ||
* Follow the instructions. | ||
|
||
What documents do you need? | ||
* Log into MilMove<{{.MyMoveLink}}> | ||
* Click on "Upload PPM Documents" | ||
* Follow the instructions | ||
|
||
To request payment, you should have copies of: | ||
* Weight tickets from certified scales, documenting empty and full weights for all vehicles and trailers you used for your move | ||
* Receipts for reimbursable expenses (see our moving tips PDF for more info) | ||
|
||
* Weight tickets from certified scales, documenting empty and full weights for all vehicles and trailers you used for your move. | ||
* Receipts for reimbursable expenses. | ||
|
||
MilMove will ask you to upload copies of your documents as you complete your payment request. | ||
|
||
What if you’re missing documents? | ||
If you are missing reciepts, you may still be able to request payment, but you will need assistance from your transportation office. | ||
|
||
If you’re missing receipts, you can still request payment. You might not get reimbursement or a tax credit for those expenses. | ||
Payment request must be submitted within 45 days of your move date. | ||
|
||
If you’re missing certified weight tickets, your PPPO will have to help. {{if .TOName}}Call {{.TOName}}{{if .TOPhone}} at {{.TOPhone}}{{end}} to have them walk you through it. Reference your move locator code: {{.Locator}}.{{end}} | ||
If you have any questions, contact a government transportation office. You can see a listing of transportation offices on Military OneSource here: <{{.OneSourceLink}}> | ||
|
||
Log in to MilMove to complete your request and get paid. | ||
Thank you, | ||
|
||
Request payment within 45 days of your move date or you might not be able to get paid. | ||
USTRANSCOM MilMove Team | ||
|
||
{{if .TOName}}If you have any questions or concerns, you can talk to a human! Call your local PPPO at {{.TOName}}{{if .TOPhone}} at {{ .TOPhone}}{{end}}. Reference your move locator code: {{.Locator}}.{{end}} | ||
The information contained in this email may contain Privacy Act information and is therefore protected | ||
under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.