Open boonebgorges opened 5 years ago
Hmm, the external ping technique is neat, but I worry about private events. How does that work? I see you try to pass the $_COOKIE
variable, but does that work effectively especially when GES now uses a queue-based system that doesn't rely on a logged-in user.
The queue processes should always contain the $_COOKIE - it's always sent with the async process, and is daisy-chained for each batch - but you're right that this could use a closer look.
A modified approach might be to fetch the ical a single time, then save it to a file.
This would all be easier if EO's ical-generation was not so context-sensitive. I wonder if Stephen would accept a PR that abstracts it.
I just ran a couple quick tests with private groups and it does appear to work, but this could use some verification. Maybe I'll throw this up on the CUNY Academic Commons and see if we can get some real world testing.
See #66.
This was surprisingly easy to do! The one trick is getting the contents of the .ics file. EO's ical.php template will only work properly with WP's routing system (
have_posts()
,is_single()
, etc), so it's not straightforward to generate the .ics programatically. The two options I saw were (a) fake the globals and load the template, or (b) make an HTTP request to get the ICS. The latter option seems (barely) less error-prone to me.Note the hoops you've got to jump through: I filter
ass_send_email_args
because it's the most convenient place to determine whether we're looking at a BPEO item, and then I conditionally hook tophpmailer_init
.Email client integration works seamlessly, which is very cool.
@r-a-y As the resident expert on ical, could you have a look at the above, and let me know whether you have a better idea about how to work around the limitations of ical generation?