Send a calendar event¶
There are many different types of calendar events, distinguished by the method:
example:
info = dict(
location='My location',
dtstart=datetime(2008, 6, 2, 15, 30),
dtend=datetime(2008, 6, 2, 24, 00),
organizer=('adentella@thundersystems.it', 'Sandro Dentella')
)
msg = EmailMessageCalendar(title, summary, from_email, recipient_list)
event = msg.get_event(info)
msg.set_attendee(event, email2, full_name) # Required for ``REQUEST``
msg.attach_calendar(event, 'PUBLISH')
msg.send()
-
class
jmb.core.utils.ics.
EmailMessageCalendar
(subject='', body='', from_email=None, to=None, bcc=None, connection=None, attachments=None, headers=None, cc=None, reply_to=None)[source]¶ An EmailMessage capable of creating a correct Ics attachment
Initialize a single email message (which can be sent to multiple recipients).
All strings used to create the message can be unicode strings (or UTF-8 bytestrings). The SafeMIMEText class will handle any necessary encoding conversions.
-
get_event
(props=None, meth='PUBLISH')[source]¶ Return a basic event to be added to a calendar event.
uuid
anddtstamp
are added by default if not present.attendee and `organizer
can be eather email or tuple (email, common_name) and will be correctly adde usingset_organizer()
and meth:set_attendee.- Parameters
props – a dict of properties to be added to the event. read rfc to get more info on usable params
meth – the method of the calendar that will be created. Default:
PUBLISH
-