mu icon indicating copy to clipboard operation
mu copied to clipboard

[mu4e rfe] Create calendar invitation

Open mankoff opened this issue 3 years ago • 4 comments

Now that we can view and accept calendar invitations in mu4e, it would be nice to be able to generate them, using mu4e and the Org-style calendar interface for scheduling.

mankoff avatar Jul 29 '22 03:07 mankoff

Would be useful -- if gnus has support we might be able re-use that; otherwise, it'd be a big job!

djcb avatar Aug 02 '22 03:08 djcb

Or maybe Org has some support and we could reuse that too.

mankoff avatar Aug 02 '22 14:08 mankoff

Please research and share your findings!

djcb avatar Aug 02 '22 16:08 djcb

if gnus has support we might be able re-use that; otherwise, it'd be a big job!

Maybe Org has some support too, which could be used.

mankoff avatar Oct 11 '22 07:10 mankoff

I have been thinking about the same functionality.

Here is a prototype.

In an draft Messages buffer, insert some text in the middle of your message like:


* team meeting

 this is a test meeting

<2022-12-31 Sat 14:00-15:00>

and then mark that region and run the following defun region-to-ics

which will then attach an .ics event. I've verified that Outlook on the web can parse this ics and save it to the online outlook calendar. What doesn't yet work is the gnus-icalendar code; it marks it as such:


[2. Invitation summary --- text/calendar; inviteNiUsEg.ics]...

[ Uninvited Accept ]    [ Uninvited Tentative ]    [ Uninvited Decline ]    

[ Show Agenda ]    

Summary:    team meeting
Location:   
Time:       <2022-12-31 14:00-15:00>
Organizer:  
Attendance: You are not listed as an attendee
Method:     nil

this is a test meeting

<2022-12-31 Sat 14:00>–<2022-12-31 Sat 15:00>

and hitting the uninvited accept button generates the message: This is a pseudo article.

So, work in progress. Feedback welcome!

(defun region-to-ics (beg end)
  (interactive "r")
  (let* (
	 (text (buffer-substring-no-properties beg end))
	 (filename (make-temp-file "invite" nil ".org" text))
	 ics-file
	 )
    (find-file filename)
    (org-icalendar-export-to-ics)
    (kill-buffer)
    (setq ics-file
	  (concat (file-name-sans-extension filename) ".ics")
	  )
    (mml-attach-file ics-file "text/calendar" "Invitation summary" "attachment")
    ))

sje30 avatar Dec 31 '22 13:12 sje30

I was about to try your code and found some code that I already had in my config. It has been there since before 2013. I am not sure where I got it from, however, so I cannot give proper attribution. I had to update it slightly to work with message mode currently.

It seems to work from my limited testing.

Given the lack of provenance information, I don't know whether it should be used directly but you could definitely get some ideas for updating your code maybe?

ericsfraga avatar Jan 01 '23 13:01 ericsfraga

Thanks Eric. I'll rewrite and then we can GPL it.

sje30 avatar Jan 01 '23 14:01 sje30

Is the code at the pastebin link above meant to work with current message mode? I had trouble using it in mu4e message mode as is. I see the note above: "I had to update it slightly to work with message mode currently."

If there is any progress towards this, I am happy to help test. I use mu4e with org mode and regularly receive ics invitations from folks at my university which works great. I save the invitations to org and then org-caldav syncs my org agenda with my nextcloud calendar). It would be nice to be able to /send/ invitations based on my org events with timestamps.

dschwilk avatar Oct 02 '23 19:10 dschwilk

Closing this old issue here, and migrated it to IDEAS.org.

djcb avatar Mar 07 '24 21:03 djcb