feat(ui): add RSVP attendance option and admin features
* Implement attendance selection in RSVP form * Add admin endpoints for managing RSVPs and guests * Update RSVP handling to include attendance status
This commit is contained in:
@@ -93,7 +93,11 @@ func (m *Mailer) SendRSVP(r store.RSVP, allGuests []store.Guest) error {
|
||||
joined := strings.Join(names, ", ")
|
||||
|
||||
var b strings.Builder
|
||||
fmt.Fprintf(&b, "New RSVP for %d guest(s) — %d adult(s), %d child(ren): %s\n", len(r.Guests), adults, children, joined)
|
||||
if r.Attending {
|
||||
fmt.Fprintf(&b, "New RSVP (ATTENDING) for %d guest(s) — %d adult(s), %d child(ren): %s\n", len(r.Guests), adults, children, joined)
|
||||
} else {
|
||||
fmt.Fprintf(&b, "New RSVP (NOT ATTENDING) — %s\n", joined)
|
||||
}
|
||||
if r.Message != "" {
|
||||
fmt.Fprintf(&b, "\nMessage:\n%s\n", r.Message)
|
||||
}
|
||||
@@ -113,7 +117,11 @@ func (m *Mailer) SendRSVP(r store.RSVP, allGuests []store.Guest) error {
|
||||
fmt.Fprintf(&b, "\n%d adult(s), %d child(ren) total\n", totalAdults, totalChildren)
|
||||
}
|
||||
|
||||
return m.send(fmt.Sprintf("RSVP from %s", joined), m.header("an RSVP is made")+b.String())
|
||||
subjectState := "attending"
|
||||
if !r.Attending {
|
||||
subjectState = "not attending"
|
||||
}
|
||||
return m.send(fmt.Sprintf("RSVP from %s (%s)", joined, subjectState), m.header("an RSVP is made")+b.String())
|
||||
}
|
||||
|
||||
func (m *Mailer) SendPhotoUpload(u store.PhotoUpload, files []store.PhotoFile) error {
|
||||
|
||||
Reference in New Issue
Block a user