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 · 2 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

@sparksp
Copy link

sparksp commented Nov 11, 2024

There is a note in the API docs about setting responseStatus directly, I don't know if this might apply to you here...

Warning: If you add an event using the values declined, tentative, or accepted, attendees with the "Add invitations to my calendar" setting set to "When I respond to invitation in email" or "Only if the sender is known" might have their response reset to needsAction and won't see an event in their calendar unless they change their response in the event invitation email. Furthermore, if more than 200 guests are invited to the event, response status is not propagated to the guests.

@ArjunChaudhary01
Copy link
Author

I have tried but does not worked.

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

2 participants