Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/GuestManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,27 +220,28 @@ public function sendEmailInvitation(Room $room, Participant $participant): void

$user = $this->userSession->getUser();
$invitee = $user instanceof IUser ? $user->getDisplayName() : '';
$roomName = $room->getDisplayName('', true);

$template = $this->mailer->createEMailTemplate('Talk.InviteByEmail', [
'invitee' => $invitee,
'roomName' => $room->getDisplayName(''),
'roomName' => $roomName,
'roomLink' => $link,
'email' => $email,
'pin' => $pin,
]);

if ($user instanceof IUser) {
$subject = $this->l->t('%1$s invited you to conversation "%2$s".', [$user->getDisplayName(), $room->getDisplayName('')]);
$subject = $this->l->t('%1$s invited you to conversation "%2$s".', [$user->getDisplayName(), $roomName]);
$message->setFrom([Util::getDefaultEmailAddress('no-reply') => $user->getDisplayName()]);
} else {
$subject = $this->l->t('You were invited to conversation "%s".', $room->getDisplayName(''));
$subject = $this->l->t('You were invited to conversation "%s".', $roomName);
$message->setFrom([Util::getDefaultEmailAddress('no-reply') => $this->defaults->getName()]);
}

$template->setSubject($subject);
$template->addHeader();
$template->addHeading(
htmlspecialchars($room->getDisplayName('')),
htmlspecialchars($roomName),
$this->l->t('Conversation invitation')
);
$template->addBodyText(
Expand Down Expand Up @@ -296,7 +297,7 @@ public function sendEmailInvitation(Room $room, Participant $participant): void
$this->l->t('Click the link below to join the lobby now.')
);
$template->addBodyButton(
$this->l->t('Join lobby for "%s"', [$room->getDisplayName('')]),
$this->l->t('Join lobby for "%s"', [$roomName]),
$link
);
} else {
Expand All @@ -306,7 +307,7 @@ public function sendEmailInvitation(Room $room, Participant $participant): void
$this->l->t('Click the link below to join the conversation now.')
);
$template->addBodyButton(
$this->l->t('Join "%s"', [$room->getDisplayName('')]),
$this->l->t('Join "%s"', [$roomName]),
$link
);
}
Expand Down
Loading