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

Adds missing email header #432

Open
wants to merge 1 commit into
base: master
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
20 changes: 11 additions & 9 deletions lib/Backend/DavListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public function handleReminders(int $lastStart, IDBConnection $db, IBackendConne

// TRANSLATORS Subject for email, Ex: {{Organization Name}} appointment reminder
$tmpl->setSubject($this->l10N->t("%s appointment reminder", [$org_name]));
$tmpl->addHeader();
// TRANSLATORS First line of email, Ex: Dear {{Customer Name}},
$tmpl->addBodyText($this->l10N->t("Dear %s,", $to_name));

Expand Down Expand Up @@ -544,6 +545,7 @@ private function handler(array $objectData, array $calendarData, bool $isDelete)

// TRANSLATORS Subject for email, Ex: {{Organization Name}} Appointment (action needed)
$tmpl->setSubject($this->l10N->t("%s appointment (action needed)", [$org_name]));
$tmpl->addHeader();
// TRANSLATORS First line of email, Ex: Dear {{Customer Name}},
$tmpl->addBodyText($this->l10N->t("Dear %s,", $to_name));

Expand Down Expand Up @@ -573,9 +575,9 @@ private function handler(array $objectData, array $calendarData, bool $isDelete)
} elseif ($hint === HintVar::APPT_CONFIRM) {
// Confirm link in the email is clicked ...
// ... or the email validation step is skipped

// TRANSLATORS Subject for email, Ex: {{Organization Name}} Appointment is Confirmed
$tmpl->setSubject($this->l10N->t("%s Appointment is confirmed", [$org_name]));
$tmpl->addHeader();
$tmpl->addBodyText($to_name . ",");
// TRANSLATORS Main body of email,Ex: Your {{Organization Name}} appointment scheduled for {{Date Time}} is now confirmed.
$tmpl->addBodyText($this->l10N->t('Your %1$s appointment scheduled for %2$s is now confirmed.', [$org_name, $date_time]));
Expand Down Expand Up @@ -625,14 +627,14 @@ private function handler(array $objectData, array $calendarData, bool $isDelete)

if ($hint !== HintVar::APPT_NONE) {
// Cancelled by the attendee (via the email link)

// TRANSLATORS Subject for email, Ex: {{Organization Name}} Appointment is Canceled
$tmpl->setSubject($this->l10N->t("%s Appointment is canceled", [$org_name]));
$tmpl->addHeader();
} else {
// Cancelled/deleted by the organizer

// TRANSLATORS Subject for email, Ex: {{Organization Name}} Appointment Status Changed
$tmpl->setSubject($this->l10N->t("%s appointment status changed", [$org_name]));
$tmpl->addHeader();
}

// TRANSLATORS Main body of email,Ex: Your {{Organization Name}} appointment scheduled for {{Date Time}} is now canceled.
Expand All @@ -655,8 +657,8 @@ private function handler(array $objectData, array $calendarData, bool $isDelete)
$ext_event_type = 1;

} elseif ($hint === HintVar::APPT_TYPE_CHANGE) {

$tmpl->setSubject($this->l10N->t("%s Appointment update", [$org_name]));
$tmpl->addHeader();
// TRANSLATORS First line of email, Ex: Dear {{Customer Name}},
$tmpl->addBodyText($this->l10N->t("Dear %s,", [$to_name]));
// TRANSLATORS Main part of email
Expand Down Expand Up @@ -694,9 +696,9 @@ private function handler(array $objectData, array $calendarData, bool $isDelete)

} elseif ($hint === HintVar::APPT_NONE) {
// Organizer or External Action (something changed...)

// TRANSLATORS Subject for email, Ex: {{Organization Name}} appointment status update
$tmpl->setSubject($this->l10N->t("%s Appointment update", [$org_name]));
$tmpl->addHeader();
// TRANSLATORS First line of email, Ex: Dear {{Customer Name}},
$tmpl->addBodyText($this->l10N->t("Dear %s,", [$to_name]));
// TRANSLATORS Main part of email
Expand Down Expand Up @@ -939,6 +941,7 @@ private function handler(array $objectData, array $calendarData, bool $isDelete)

$tmpl->setSubject($om_prefix . ": " . $to_name . ", "
. $utils->getDateTimeString($evt_dt, $utz_info, 1));
$tmpl->addHeader();
$tmpl->addHeading(" "); // spacer
$tmpl->addBodyText($om_prefix);
$tmpl->addBodyListItem($utils->getDateTimeString($evt_dt, $utz_info));
Expand Down Expand Up @@ -1195,7 +1198,6 @@ private function getOrgInfo($userId, $pageId)

function finalizeEmailText(&$tmpl, $cnl_lnk_url)
{

$tmpl->addBodyText($this->l10N->t("Thank you"));

// cancellation link for confirmation emails
Expand Down Expand Up @@ -1252,13 +1254,13 @@ private function getPhoneFromDescription(string $description): string
return $ret;
}

private function addMoreEmailText(IEMailTemplate $template, string $text)
private function addMoreEmailText(IEMailTemplate $tmplate, string $text)
{
list($html, $plainText) = $this->prepHtmlEmailText($text);
if ($html === null) {
$template->addBodyText($plainText);
$tmplate->addBodyText($plainText);
} else {
$template->addBodyText($html, $plainText);
$tmplate->addBodyText($html, $plainText);
}
}

Expand Down