1
1
package hmda .api .http .institutions .submissions
2
2
3
+ import java .time .{ ZoneOffset , ZonedDateTime }
4
+
3
5
import akka .actor .{ ActorRef , ActorSystem }
4
6
import akka .event .LoggingAdapter
5
7
import akka .pattern .ask
@@ -130,9 +132,11 @@ trait SubmissionSignPaths
130
132
val session = Session .getDefaultInstance(properties)
131
133
val message = new MimeMessage (session)
132
134
133
- val text = s " $username, \n Congratulations, you've completed filing your HMDA data for filing period ${submission.id.period}. \n " +
134
- s " We received your filing on: ${submission.end}\n " +
135
- s " Your receipt is: ${submission.receipt}"
135
+ val date = getFormattedDate
136
+
137
+ val text = s " $username, \n\n Congratulations, you've completed filing your HMDA data for filing period ${submission.id.period}. \n " +
138
+ s " We received your filing on: $date\n " +
139
+ s " Your receipt is: ${submission.receipt}"
136
140
message.setFrom(new InternetAddress (" no-reply@test.com" ))
137
141
message.setRecipients(Message .RecipientType .TO , address)
138
142
message.setSubject(" HMDA Filing Successful" )
@@ -141,4 +145,15 @@ trait SubmissionSignPaths
141
145
log.info(s " Sending message to $address with the message \n $text" )
142
146
Transport .send(message)
143
147
}
148
+
149
+ private def getFormattedDate : String = {
150
+ val offset = ZoneOffset .ofHours(- 5 )
151
+ val zonedTime = ZonedDateTime .now(offset)
152
+
153
+ val day = zonedTime.getDayOfMonth
154
+ val month = zonedTime.getMonthValue
155
+ val year = zonedTime.getYear
156
+
157
+ s " $month/ $day/ $year"
158
+ }
144
159
}
0 commit comments