Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(appointments): add timezone to all emails #6356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions lib/Service/Appointments/MailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,24 @@ private function addBulletList(IEMailTemplate $template,
bool $recipient): void {
$template->addBodyListItem($booking->getDisplayName(), $l10n->t('Appointment for:'));

// determain timezone depending on who is getting the message (Requestee/Requester)
// determine timezone depending on who is getting the message (Requestee/Requester)
$tzid = ($recipient) ? $config->getAvailabilityAsArray()['timezoneId'] : $booking->getTimezone();
$dtstart = new \DateTime('now', new \DateTimeZone($booking->getTimezone())); // generate DateTime with booking time zone
$dtstart->setTimestamp($booking->getStart()); // set booking time stamp

$l = $this->lFactory->findGenericLanguage();
$relativeTimezone = new \DateTimeZone($tzid);
$relativeDateTime = $this->dateFormatter->formatDateTimeRelativeDay(
$dtstart,
'long',
'short',
new \DateTimeZone($tzid),
$relativeTimezone,
$this->lFactory->get('calendar', $l)
);

$template->addBodyListItem($relativeDateTime, $l10n->t('Date:'));
$timestring = $relativeDateTime . ' (' . $relativeTimezone->getName() . ')';
miaulalala marked this conversation as resolved.
Show resolved Hide resolved
miaulalala marked this conversation as resolved.
Show resolved Hide resolved

$template->addBodyListItem($timestring, $l10n->t('Date:'));

if (!$booking->isConfirmed() && $config->getCreateTalkRoom()) {
$template->addBodyListItem($l10n->t('You will receive a link with the confirmation email'), $l10n->t('Where:'));
Expand Down
Loading