diff --git a/lib/MailQueueHandler.php b/lib/MailQueueHandler.php
index 36c6e129c..dff6c47b4 100644
--- a/lib/MailQueueHandler.php
+++ b/lib/MailQueueHandler.php
@@ -436,10 +436,16 @@ protected function getHTMLSubject(IEvent $event): string {
foreach ($event->getRichSubjectParameters() as $placeholder => $parameter) {
$placeholders[] = '{' . $placeholder . '}';
+ if ($parameter['type'] === 'file') {
+ $replacement = $parameter['path'];
+ } else {
+ $replacement = $parameter['name'];
+ }
+
if (isset($parameter['link'])) {
- $replacements[] = '' . htmlspecialchars($parameter['name']) . '';
+ $replacements[] = '' . htmlspecialchars($replacement) . '';
} else {
- $replacements[] = '' . htmlspecialchars($parameter['name']) . '';
+ $replacements[] = '' . htmlspecialchars($replacement) . '';
}
}