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

Include attendeeEmail in redirect formdata #572

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion lib/Backend/BackendUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,11 @@ function dataConfirmAttendee(string $data, string $userId, string $pageId): arra
}

/**
* @return array [string|null, int, string]
* @return array [string|null, int, string, string]
* date_time: Localized DateTime string or null on error
* state: one of self::PREF_STATUS_*
* attendeeName: or empty if error
* attendeeEmail: or empty if error
*/
function dataApptGetInfo(?string $data): array
{
Expand Down Expand Up @@ -645,8 +646,11 @@ function dataApptGetInfo(?string $data): array
);
}

$attendeeEmailMailto = $a->getValue();

// Attendee Name
$ret[2] = $a->parameters['CN']->getValue();
$ret[3] = $attendeeEmailMailto ? substr($attendeeEmailMailto, strpos($attendeeEmailMailto, ':') + 1) : '';

return $ret;
}
Expand Down
5 changes: 3 additions & 2 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public function cncf(bool $embed = false): Response
if (($data = $this->bc->getObjectData($otherCalId, $uri)) !== null) {
// this appointment is confirmed already

list($date_time, $state, $attendeeName) = $this->utils->dataApptGetInfo($data);
list($date_time, $state, $attendeeName, $attendeeEmail) = $this->utils->dataApptGetInfo($data);

if ($date_time !== null && $state === BackendUtils::PREF_STATUS_CONFIRMED) {
$sts = 0;
Expand All @@ -406,7 +406,7 @@ public function cncf(bool $embed = false): Response
$data = $this->bc->getObjectData($otherCalId, $uri);
}

list($date_time, $state, $attendeeName) = $this->utils->dataApptGetInfo($data);
list($date_time, $state, $attendeeName, $attendeeEmail) = $this->utils->dataApptGetInfo($data);

if ($date_time === null) {
// error
Expand Down Expand Up @@ -440,6 +440,7 @@ public function cncf(bool $embed = false): Response
}
if ($settings[BackendUtils::ORG_CONFIRMED_RDR_DATA] === true) {
$d["name"] = $attendeeName;
$d["email"] = $attendeeEmail ?? null;
$d["dateTimeString"] = $date_time;
}

Expand Down