GoogleContactsEventsNotifier icon indicating copy to clipboard operation
GoogleContactsEventsNotifier copied to clipboard

Major rework of photo handling

Open stephankn opened this issue 4 years ago • 5 comments

  • fetch contact photo from contact API
  • reformat to contain fully validated html on all mail clients
  • Include freely usable default avatar, hard-coded to reduce external requests and optimize run-time of script
  • warning free with ESLint v7.0.0

stephankn avatar May 10 '20 11:05 stephankn

fixes #162

stephankn avatar May 10 '20 11:05 stephankn

I did re-format the html email to comply with standards. It is fully valid html and uses only elements which are supported on all clients. I referred to https://www.campaignmonitor.com/

I replaced the avatar image for contacts without photos with a free one to not violate copyrights of someone (google?). To reduce network requests I included it hard-coded in the source. Resolution is high enough even for retina-resolution clients.

Images are sized based on em to scale with different font sizes.

Tested with Thunderbird on desktop, K9 on mobile and GMX as webmailer.

GMX: GoogleContactsEventNotifier_gmx

K9: GoogleContactsEventNotifier_k9

Thunderbird: GoogleContactsEventNotifier_thunderbird

stephankn avatar May 10 '20 11:05 stephankn

Specifically verified with: https://validator.w3.org/ https://www.campaignmonitor.com/css/ https://eslint.org/demo

stephankn avatar May 10 '20 11:05 stephankn

I want to add: I did not fully understand what is left to merge as there are no Google+ profiles any more. In my setup all contacts having photos show up properly. Potentially the merging needs to be adjusted a bit around the default contact picture.

stephankn avatar May 10 '20 16:05 stephankn

Hello @stephankn: thank you for your contribution and I am really sorry for letting you wait.
Lots of people have requested a better support for profile images of the various contacts, but it looks like Google is making this quite hard...

I've rapidly tested your implementation and with my contacts it does not look like it resulted in more photos being shown than before, however while reasearching for other methods to fetch a contact profile photo I found out that the API you used will be deprecated in less than a year.

I do not think deploying this change only to take it back in less than a year would be worth it especially due to the slow update cycle of this project.

I'll consider in the next days merging the other part (regarding the restyling of the HTML code) which I must say looks quite nice.

Thank you again

GioBonvi avatar Aug 10 '20 16:08 GioBonvi