I am usng exchangelib in conjunction with Django 1.11 to manage Calendar items. Can anyone provide any guidance on the best way to pass emails to the required_attendees of CalendarItem in my views.py
file?
required_attendees = [Attendee(mailbox=Mailbox(email_address='user1@example.com'),
response_type='Accept')]
The number of emails could be from zero to many, eg:
required_attendees = [Attendee(mailbox=Mailbox(email_address='user1@example.com'),
response_type='Accept'),
Attendee(mailbox=Mailbox(email_address='user2@example.com'),
response_type='Accept')]
At the moment I am repeating code using IF statements based on the length of a list containing all the email addresses. It works but obviously is not the correct way to do it and is very inelegant code.
Any guidance will be greatly appreciated! Cheers