Skip to content

Commit

Permalink
Merge pull request #179 from sandeep14k/main
Browse files Browse the repository at this point in the history
adding deadline in mail body
  • Loading branch information
yashlm authored Oct 10, 2024
2 parents 10ea13d + 8c9d181 commit d70f4e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rc/admin.notice.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func CreateNotice(ctx *gin.Context, id uint, notice *Notice) error {
notice.RecruitmentCycleID = uint(id)
notice.LastReminderAt = 0
notice.CreatedBy = middleware.GetUserID(ctx)

return createNotice(ctx, notice)
}

Expand Down Expand Up @@ -134,7 +133,14 @@ func postReminderHandler(mail_channel chan mail.Mail) gin.HandlerFunc {
return
}

mail_channel <- mail.GenerateMails(emails, "Notice: "+notice.Title, notice.Description)
mailBody := notice.Description
if notice.Deadline > 0 {
deadlineTime := time.Unix(int64(notice.Deadline), 0)
deadlineStr := deadlineTime.Format("02 Jan 2006 15:04")
mailBody += "\n\nDeadline: " + deadlineStr
}

mail_channel <- mail.GenerateMails(emails, "Notice: "+notice.Title, mailBody)

ctx.JSON(http.StatusOK, gin.H{"status": "mail sent"})
}
Expand Down

0 comments on commit d70f4e6

Please sign in to comment.