spatie / calendar-links

Generate add to calendar links for Google, iCal and other calendar systems
https://spatie.be/opensource
MIT License
914 stars 148 forks source link

Gmail stripping ICS link #182

Closed dathwa closed 1 month ago

dathwa commented 9 months ago

Hello.

PHP Version: 8.0 Package version: 1.8.5 Chrome browser. Gmail is stripping out the ICS link. I'm seeing this in the "view original":

<a href=3D"data:text/calendar;charset=3Dutf8;b=
ase64,QkVHSU46VkNBTEVOREFSDQpWRVJTSU9OOjIuMA0KUFJPRElEOlNwYXRpZSBjYWxlbmRhc=
i1saW5rcw0KQkVHSU46VkVWRU5UDQpVSUQ6MDU3MjhkYWE4YjM5MDI3YWRkYzM0ZGU4N2E3Njlh=
NTYNClNVTU1BUlk6MjAyNCBIb29rdXANCkRUU1RBTVA6MjAyNDEyMDFUMDkwMDAwWg0KRFRTVEF=
SVDoyMDI0MTIwMVQwOTAwMDBaDQpEVEVORDoyMDI0MTIwMVQxNzAwMDBaDQpFTkQ6VkVWRU5UDQ=
pFTkQ6VkNBTEVOREFS" target=3D"_blank" rel=3D"noopener">ICS (for iCal & Outl=
ook)</a>

The links work OK when i post them to the page (in the same chrome browser. Anything I can do about this? Thank-you.

spatie-bot commented 5 months ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

dathwa commented 5 months ago

Please keep this open. Looking forward to a human response. Thank-you.

alies-dev commented 5 months ago

@dathwa I see your code contains 3D image

Probably you use some HTML encoding tools or char espacping that breaks the URL

Dylan-Buth commented 5 months ago

We're running into the same problem. We haven't test it yet, but this is what ChatGPT had to say about it.

The issue you’re facing with the Spatie calendar-links package generating an ics() link that is not clickable in Gmail is likely due to the use of a data: URL. Gmail does not handle data: URLs well, especially for attachments like ICS files.

A more reliable approach is to generate the ICS file content, save it to a publicly accessible location (like your server or a cloud storage), and then provide a direct link to that file in the email.

Steps to Solve the Issue

  1. Generate the ICS content using Spatie’s calendar-links package.
  2. Save the ICS content to a file.
  3. Provide a public URL to the saved ICS file in the email.
Dylan-Buth commented 5 months ago

Please keep this open. Looking forward to a human response. Thank-you.

I'd also like this to be re-opened.

dathwa commented 5 months ago

I found this: https://stackoverflow.com/questions/4016067/whats-a-3d-doing-in-this-html

It could be an environment issue. I am using octoberCMS/Laravel with the Mall plugin. I'll do more digging.

Dylan-Buth commented 5 months ago

We decided to just add an api endpoint that will return the ics data, and link to that in the email.

spatie-bot commented 1 month ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.