Skip to content

Add Optional Variables in Email Templating #835

@rampecke

Description

@rampecke

formatOptionalString returns "Not available" for blank/null values.

For location and streamUrl, this means a missing stream URL will render as "Not available" in the email rather than an empty string. Verify this is the intended behavior — if not, use valueOrEmpty directly or a different formatter.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@server/src/main/java/de/tum/cit/aet/thesis/mailVariables/MailThesisPresentation.java`
around lines 31 - 32, The current code passes presentation.getLocation() and
presentation.getStreamUrl() through DataFormatter.formatOptionalString which
returns "Not available" for blank/null; to render empty string instead, replace
valueOrEmpty(DataFormatter.formatOptionalString(presentation.getLocation())) and
valueOrEmpty(DataFormatter.formatOptionalString(presentation.getStreamUrl()))
with valueOrEmpty(presentation.getLocation()) and
valueOrEmpty(presentation.getStreamUrl()) respectively (or if you prefer a
different formatting, call the formatter that preserves empty -> ""), updating
these occurrences in MailThesisPresentation.

Originally posted by @coderabbitai[bot] in #830 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions