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

Organizer is set to "join now" immediately but i have to set other selected attendees also "join now" immediately without asking "ask to join" #2609

Open
ArjunChaudhary01 opened this issue Jul 4, 2024 · 0 comments

Comments

@ArjunChaudhary01
Copy link

ArjunChaudhary01 commented Jul 4, 2024

        // Prepare attendees array
        $attendees = [];
        // Add organizer with 'responseStatus' set to 'accepted'
        $attendees[] = new \Google_Service_Calendar_EventAttendee([
            'email' => $user->email,
            'responseStatus' => 'accepted', // Organizer should join immediately
        ]);

        // Add selected attendees with 'responseStatus' set to 'accepted'
        foreach ($this->staff as $userId) {
            $attendeeUser = User::find($userId);
            if ($attendeeUser) {
                $attendees[] = new \Google_Service_Calendar_EventAttendee([
                    'email' => $attendeeUser->email,
                    'responseStatus' => 'accepted', // Selected attendees should join immediately  (this responsestatus not working)
                ]);
            }
        }
        // Create Event
        $event = new Calendar\Event([
            'summary' => $this->title,
            'start' => new Calendar\EventDateTime([
                'dateTime' => $startDateTime,
                'timeZone' => 'Asia/Tokyo',
            ]),
            'end' => new Calendar\EventDateTime([
                'dateTime' => $endDateTime,
                'timeZone' => 'Asia/Tokyo',
            ]),
            'attendees' =>  $attendees, // Add attendees
            'conferenceData' => new Calendar\ConferenceData([
                'createRequest' => new Calendar\CreateConferenceRequest([
                    'requestId' => uniqid(),
                    'conferenceSolutionKey' => new Calendar\ConferenceSolutionKey([
                        'type' => 'hangoutsMeet',
                    ]),
                ]),
            ]),
            'visibility' => 'public', // Make the event public
        ]);

please comment on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant