Skip to content

Commit adf256e

Browse files
authored
qr code fixes (#293)
* feat: QueueWelcomeEmail api route, handler and service * refactor: pass template data in struct * fix: property names * feat: qr image generation, upload, link generation, and welcome email queue * feat: get slice of attendee userIds, added route to send all welcome emails; fixes: various * fix: error msg, email template * feat: err log on empty contact email and continue loop * fix: dont break loop
1 parent 1522649 commit adf256e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

apps/api/internal/api/handlers/bat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (h *BatHandler) SendWelcomeEmails(w http.ResponseWriter, r *http.Request) {
218218

219219
err = h.BatService.SendWelcomeEmailToAttendees(r.Context(), eventId)
220220
if err != nil {
221-
res.SendError(w, http.StatusInternalServerError, res.NewError("internal_err", "Failed to create ScheduleWaitlistTransition task."))
221+
res.SendError(w, http.StatusInternalServerError, res.NewError("internal_err", "Failed to send welcome emails."))
222222
}
223223

224224
res.Send(w, http.StatusCreated, nil)

apps/api/internal/email/templates/WelcomeEmail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ <h3 style="margin:10px 0; font-size:18px; color:#1a1a1a;">Check-in & Day Of</h3>
102102
that we don’t give your spot away to those in the in-person waitlist. At check-in, you will present
103103
your check-in QR code found below and receive the badge you will use to guarantee you access to venue,
104104
food, and events. The QR code can also be found in the <a href="https://app.swamphacks.com/"
105-
style="color:#1155cc; text-decoration:underline;">portal.</a></li>
105+
style="color:#1155cc; text-decoration:underline;">portal</a>.</li>
106106

107107
<div style="text-align:center; margin:20px 0;">
108108
<div

apps/api/internal/services/bat.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,12 @@ func (s *BatService) SendWelcomeEmailToAttendees(ctx context.Context, eventId uu
459459
}
460460
contactEmail, ok := contactInfo.ContactEmail.(string)
461461
if !ok {
462-
return ErrFailedToGetContactEmail
462+
s.logger.Err(err).Msgf("could got convert id %s", userId)
463+
continue
464+
}
465+
if contactEmail == "" {
466+
s.logger.Err(err).Msgf("empty contact email found for user with id %s", userId)
467+
continue
463468
}
464469

465470
err = s.emailService.QueueWelcomeEmail(ctx, contactEmail, contactInfo.Name, userId)

0 commit comments

Comments
 (0)