dacastro4 / laravel-gmail

Laravel wrapper for the Gmail API
MIT License
292 stars 134 forks source link

Update Replyable.php to fix threading when reply #232

Closed skn-036 closed 2 years ago

skn-036 commented 2 years ago

Hi I have used your package to make a complete gmail mailbox. From my experience, some changes will make this repo even more better.

  1. When a email has been replied, the emails are not grouped together as a thread in the receivers mailbox. This is because 'In-Reply-To' header should be set to 'Message-ID' header of the email that is being replied. Currently it is set to 'In-Reply-To' header of the parent email. so if that header exists, current reply is occuring on parent emails 'In-reply-To' message. if that header does not exist, it creates a separate thread.

  2. 'Message-ID' header is not consistent through all emails in gmail. But one of either 'Message-ID' or 'Message-Id' header is always present. So added a function to get consistent 'Message-ID' header.