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

Make ticket holder email optional #1009

Open
wants to merge 2 commits into
base: develop
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions app/Http/Controllers/EventCheckoutController.php
Expand Up @@ -159,11 +159,10 @@ public function postValidateTickets(Request $request, $event_id)
*/
$validation_rules['ticket_holder_first_name.' . $i . '.' . $ticket_id] = ['required'];
$validation_rules['ticket_holder_last_name.' . $i . '.' . $ticket_id] = ['required'];
$validation_rules['ticket_holder_email.' . $i . '.' . $ticket_id] = ['required', 'email'];
$validation_rules['ticket_holder_email.' . $i . '.' . $ticket_id] = ['nullable', 'email'];

$validation_messages['ticket_holder_first_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s first name is required';
$validation_messages['ticket_holder_last_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s last name is required';
$validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s email is required';
$validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.email'] = 'Ticket holder ' . ($i + 1) . '\'s email appears to be invalid';

/*
Expand Down Expand Up @@ -728,8 +727,10 @@ public function completeOrder($event_id, $return_json = true)
// Send tickets to attendees
Log::debug('Queueing Attendee Ticket Jobs');
foreach ($order->attendees as $attendee) {
SendOrderAttendeeTicketJob::dispatch($attendee);
Log::debug('Queueing Attendee Ticket Job Done');
if (isset($attendee->email) && !empty($attendee->email) && $attendee->email !== $order->email) {
SendOrderAttendeeTicketJob::dispatch($attendee);
Log::debug('Queueing Attendee Ticket Job Done');
}
}

if ($return_json) {
Expand Down
Expand Up @@ -195,7 +195,7 @@
<div class="col-md-12">
<div class="form-group">
{!! Form::label("ticket_holder_email[{$i}][{$ticket['ticket']['id']}]", trans("Public_ViewEvent.email_address")) !!}
{!! Form::text("ticket_holder_email[{$i}][{$ticket['ticket']['id']}]", null, ['required' => 'required', 'class' => "ticket_holder_email.$i.{$ticket['ticket']['id']} ticket_holder_email form-control"]) !!}
{!! Form::text("ticket_holder_email[{$i}][{$ticket['ticket']['id']}]", null, ['class' => "ticket_holder_email.$i.{$ticket['ticket']['id']} ticket_holder_email form-control"]) !!}
</div>
</div>
@include('Public.ViewEvent.Partials.AttendeeQuestions', ['ticket' => $ticket['ticket'],'attendee_number' => $total_attendee_increment++])
Expand Down