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

How to send meeting-invites? #95

Open
alachnit opened this issue Oct 23, 2024 · 0 comments
Open

How to send meeting-invites? #95

alachnit opened this issue Oct 23, 2024 · 0 comments

Comments

@alachnit
Copy link

Hi,
is there an easy way to send calendar-invitations with an attached invite.ics-file?

This is what I tried:

from icalendar import Calendar, Event as iCalEvent
ical_event = self.createIcalEvent(subject, obj.event) # this method creates the ical

email = EmailSender(
    host=self.instance.settings["mail"]["server"],
    port=self.instance.settings["mail"]["port"],
    cls_smtp=SMTP_SSL,
    use_starttls=False,
    username=self.instance.settings["mail"]["username"],
    password=self.instance.settings["mail"]["password"],
)

email.send(
    subject=subject,
    sender=sender,
    receivers=[recipient],
    text="Please find the calendar invite for our upcoming meeting.",
    attachments={'invite.ics': ical_event},
    headers={
        "Content-Class": "urn:content-classes:calendarmessage",
    },
)

This email gets sent with the invite.ics, but mailclients don't recognize it as an invitation. the invite.ics is simply an attachment.

Thank you in advance
Till

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

1 participant