Skip to content

Backend/requests: Support .ics attachments - #8471

Merged
tristanlabelle merged 6 commits into
developfrom
backend/feature/host-requests-ics
May 13, 2026
Merged

Backend/requests: Support .ics attachments#8471
tristanlabelle merged 6 commits into
developfrom
backend/feature/host-requests-ics

Conversation

@tristanlabelle

@tristanlabelle tristanlabelle commented May 7, 2026

Copy link
Copy Markdown
Contributor

Generates and attaches iCalendar .ics files to host request accepted+confirmed emails, which are detected by mail clients like Gmail or manually importable in calendar apps.

Caveats:

  • The host receives the .ics file in the host request accepted notification email, even though they haven't confirmed yet, because they don't receive a further email upon confirming that could carry the .ics.
  • The surfer receives the .ics file upon the host confirming, which makes sense.
  • Upon cancellation, only the party getting cancelled on receives an email with the cancellation .ics, since the cancelling party does not get an email.

Unfortunately the ics library pulls in the arrow and tatsu libraries. Its beefier alternative icalendar depends on python-dateutil and tzdata, which we are already pulling in. I can port over if this is a concern. The format is simple enough for our needs that we could even implement it ourselves.

Fixes #8461

Testing

Run the backend and frontend, and follow these steps:

  1. Log in as user A, send a host request to user B, log out
  2. Log in as user B, accept the host request, notice in maildev the acceptance email to user A, download the email .eml file, then https://www.encryptomatic.com/viewer/ to extract the attachment, then import it into Gmail from settings, log out
  3. Log in as user A, confirm the host request, notice in maildev the confirmation email to user B, validate ics attachment
  4. Still as user A, cancel the host request, notice in maildev the confirmation email to user A, validate ics attachment

Also added tests

Backend checklist

  • Added tests for any new code or added a regression test if fixing a bug
  • Run the backend locally and it works
  • Added migrations if there are any database changes, rebased onto develop if necessary for linear migration history

For maintainers

  • Maintainers can push commits to my branch
  • Maintainers can merge this PR for me

@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
couchers Ready Ready Preview May 12, 2026 0:46am

Request Review

@aapeliv aapeliv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i love this idea, let me know when it's ready for review

@tristanlabelle
tristanlabelle marked this pull request as ready for review May 8, 2026 02:44
aapeliv
aapeliv previously approved these changes May 10, 2026

@aapeliv aapeliv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it looks good overall

Comment thread app/backend/src/couchers/email/calendar_events.py Outdated
Comment thread app/backend/src/couchers/email/calendar_events.py Outdated
@tristanlabelle

Copy link
Copy Markdown
Contributor Author

@aapeliv Addressed comments. Ready for ✅ !

@tristanlabelle
tristanlabelle merged commit 315fdef into develop May 13, 2026
9 checks passed
@tristanlabelle
tristanlabelle deleted the backend/feature/host-requests-ics branch May 13, 2026 02:35
@github-actions github-actions Bot added the release notes: pending Add to stuff that should be included in release notes label May 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📝 Release Notes

This PR should be included in the release notes.

Suggested release note:

Added calendar invite attachments to host request emails so accepted, confirmed, and cancelled stays can be easily added to calendar apps
🤖 Bot Debug Information

Model: couchers.openai.gpt-5.4
Decision: include
Reasoning: This adds a noticeable user-facing improvement: host request acceptance, confirmation, and cancellation emails can now include calendar invite attachments that users can add to their calendar apps. It directly improves trip planning and is something end users will see and use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: pending Add to stuff that should be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend/emails: support attachments (for event ical's)

2 participants