A
A
Albion262020-08-27 16:07:05
Python
Albion26, 2020-08-27 16:07:05

How to add several emails to guests in a new Google Calendar event?

The task is as follows: we have a common file in Google Sheets that contains various events and general information on them to be sent to the Calendar. We iterate through the entire file and send these events to the calendar through the ready-made Python code.
But all these events may have a different number of people ( Guests ), to whom they should go + it can be different people depending on the event. 5f47ad9619d42177721906.jpeg
The event has a parameter - attendees to send this event to a specific person, but for each individual address, you must specify this separately. It is necessary to somehow transfer the cell from Google Sheets to the list and, depending on the number of addresses in this cell, send this event to everyone who is listed there.

event = {
          'summary': summary,
          'location': None,
          'description': description,
          'start': {
            'dateTime': start_date_object.strftime('%Y-%m-%dT%H:%M:%S'),
            'timeZone': timezone,
          },
          'end': {
            'dateTime': finish_date_object.strftime('%Y-%m-%dT%H:%M:%S'),
            'timeZone': timezone,
          },
        'attendees': [
             {'email': '[email protected],'},
             {'email': '[email protected]'},
        ],
          'reminders': {
            'useDefault': False,
            'overrides': [
              {'method': 'email', 'minutes': 24 * 60},
              {'method': 'popup', 'minutes': 10},
            ],
          },
        }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question