Skip to content

Commit a55b54c

Browse files
committed
Fix timezone
1 parent 09aa213 commit a55b54c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

api/pkg/emails/hermes_user_email_factory.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,20 @@ func NewHermesUserEmailFactory(config *HermesGeneratorConfig) UserEmailFactory {
114114

115115
// PhoneDead is the email sent to a user when their phone is dead
116116
func (factory *hermesUserEmailFactory) PhoneDead(user *entities.User, lastHeartbeatTimestamp time.Time, owner string) (*Email, error) {
117+
location, err := time.LoadLocation(user.Timezone)
118+
if err != nil {
119+
location = time.UTC
120+
}
121+
117122
email := hermes.Email{
118123
Body: hermes.Body{
119124
Intros: []string{
120-
fmt.Sprintf("We haven't received any heartbeat event from your mobile phone %s since %s.", owner, lastHeartbeatTimestamp.Format(time.RFC1123)),
125+
fmt.Sprintf("We haven't received any heartbeat event from android phone %s since %s.", owner, lastHeartbeatTimestamp.In(location).Format(time.RFC1123)),
121126
fmt.Sprintf("Check if the mobile phone is powered on and if it has stable internet connection."),
122127
},
123128
Actions: []hermes.Action{
124129
{
125-
Instructions: "Click the button below to upgrade your plan and continue sending more messages",
130+
Instructions: "Check your heartbeat events on httpSMS",
126131
Button: hermes.Button{
127132
Color: "#329ef4",
128133
TextColor: "#FFFFFF",

0 commit comments

Comments
 (0)