Mail #summary# has no separator between booking items #5

Closed
opened 2026-10-10 17:01:53 +02:00 by pepa · 0 comments
Owner

Found while writing unit tests (#2). This one comes from reading the code; it has not been reproduced with a test or a real e-mail yet.

Problem

MailMessage::replace_body_vars (src/backend/mail.rs) builds the #summary# value by appending "{name}: {from} - {to}" for every reservation item without any separator. A booking with more than one item would be rendered as:

Court 1: 08:00 - 09:00Court 2: 10:00 - 11:00

Suggested fix

Join the items with a newline (or ", "), e.g. collect into a Vec<String> and join("\n"), and add a unit test with two items next to mail_message_replaces_variables.

Found while writing unit tests (#2). This one comes from reading the code; it has not been reproduced with a test or a real e-mail yet. ## Problem `MailMessage::replace_body_vars` (`src/backend/mail.rs`) builds the `#summary#` value by appending `"{name}: {from} - {to}"` for every reservation item without any separator. A booking with more than one item would be rendered as: ``` Court 1: 08:00 - 09:00Court 2: 10:00 - 11:00 ``` ## Suggested fix Join the items with a newline (or `", "`), e.g. collect into a `Vec<String>` and `join("\n")`, and add a unit test with two items next to `mail_message_replaces_variables`.
pepa closed this issue 2026-10-10 17:19:34 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ITsolved/rezervovator#5