Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google calendar api not showing the organizer name and sending notification emails - laravel

I'm using a laravel package for the google calendar API integration. In that, I am able to create events with just attendees only. I've tried creating organizer but it's not coming up. The following is the code I've used. The organizer name here defaults to the email from which the API credentials are created also the email notifications are not coming.

The package I'm using is spatie/laravel-google-calendar

Can anyone tell me what I'm doing wrong here?

Event::create([
               'name' => 'Latest Event dsfdsfsdfsdf',
               'location' => '800 Howard St., San Francisco, CA 94103',
               'description' => 'A chance to hear more about Google\'s developer products.',           
               'startDateTime' => Carbon\Carbon::now(),
               'endDateTime' => Carbon\Carbon::now()->addHour(),
               'sendNotifications' => true,
               'sendUpdates' => 'all',
               'organizer' => array('email' => '[email protected]','displayName' => 'Darshan')
               'attendees' => array(
                array('email' => '[email protected]','displayName' => 'Darshan', 'organizer' => true),
                array('email' => '[email protected]','displayName' => 'Ryan')
              )
            ]); 
like image 789
Darshan Avatar asked Nov 06 '22 20:11

Darshan


1 Answers

The package doesn't support adding an organizer yet. You could either add the functionality to the package or you could use the Google ApiClient directly. The Google Sdk does have a setOrganizer method which should work similar to the setAttendees method that is called in the Event class.

Apparently the word "organizer" is bit of a misnomer and it actually refers to the calendar that the event is created on. Have a look at this question and it's comments.

like image 196
D Malan Avatar answered Nov 25 '22 22:11

D Malan