Add speaker invitations with portal page and programme host picker.
Deploy Ladill Events / deploy (push) Successful in 47s
Deploy Ladill Events / deploy (push) Successful in 47s
Speakers require email, get a personal holding page with programme and stage links, auto-invites when programme hosts are saved, and manual send for events without a schedule; also fix wallet copy on event create and anchor attendee comms. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -50,14 +50,59 @@ class EventProgrammeService
|
||||
public function hostsFromItems(array $items): array
|
||||
{
|
||||
return collect($items)
|
||||
->pluck('host')
|
||||
->filter(fn ($host) => is_string($host) && trim($host) !== '')
|
||||
->map(fn ($host) => trim($host))
|
||||
->flatMap(function ($item) {
|
||||
if (! is_array($item)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$email = strtolower(trim((string) ($item['host_speaker_email'] ?? '')));
|
||||
if ($email !== '' && filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
return [$email];
|
||||
}
|
||||
|
||||
$host = trim((string) ($item['host'] ?? ''));
|
||||
if ($host !== '' && filter_var($host, FILTER_VALIDATE_EMAIL)) {
|
||||
return [$host];
|
||||
}
|
||||
|
||||
if ($host !== '') {
|
||||
return [$host];
|
||||
}
|
||||
|
||||
return [];
|
||||
})
|
||||
->unique()
|
||||
->values()
|
||||
->all();
|
||||
}
|
||||
|
||||
/** @return list<array{email: string, name: string}> */
|
||||
public function speakerOptionsForProgramme(QrCode $programme): array
|
||||
{
|
||||
$options = [];
|
||||
|
||||
foreach ($this->eventsLinkedToProgramme($programme) as $event) {
|
||||
foreach ((array) ($event->content()['speakers'] ?? []) as $speaker) {
|
||||
if (! is_array($speaker)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$email = trim((string) ($speaker['email'] ?? ''));
|
||||
$name = trim((string) ($speaker['name'] ?? ''));
|
||||
if ($email === '' || ! filter_var($email, FILTER_VALIDATE_EMAIL) || $name === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$options[strtolower($email)] = [
|
||||
'email' => $email,
|
||||
'name' => $name,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return array_values($options);
|
||||
}
|
||||
|
||||
/** @return Collection<int, QrCode> */
|
||||
public function eventsLinkedToProgramme(QrCode $programme): Collection
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user