Download the PHP package alexpcooper/newsletters-to-kindle without Composer
On this page you can find all versions of the php package alexpcooper/newsletters-to-kindle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexpcooper/newsletters-to-kindle
More information about alexpcooper/newsletters-to-kindle
Files in alexpcooper/newsletters-to-kindle
Package newsletters-to-kindle
Short Description Uses IMAP to check a mailbox, converts HTML newsletter emails to PDFs and sends them to Amazon Kindle email address
License mit
Homepage https://github.com/alexpcooper/newsletters-to-kindle/
Informations about the package newsletters-to-kindle
Newsletters to Kindle
Uses IMAP to check a mailbox, converts HTML newsletter emails to PDFs and sends them to an Amazon Kindle email address
Process
- Checks a folder in an email inbox, via IMAP
- Collects the email and converts it into a PDF
- Sends the PDF to Amazon, to convert into an ePub format and place in your Amazon Kindle library
- Deletes the email
Installation
Official installation method is via composer and its packagist package alexpcooper/newsletters-to-kindle.
Usage
Debug
As the process of sending an email to a 3rd party (Amazon) is "fire and forget", without any confirmation or failure, there are two optional parameters, in the event of needing to troubleshoot.
Add one or both of these prior to calling checkMail()
.
Parameters
Parameter | Explanation |
---|---|
kindle_email | Used to send the PDF email to, so that it goes to your Amazon account |
imap settings | Used to both check an email directory, such as your inbox, for an email to convert, as well as to send the PDF to Amazon as the FROM address |
imap_dir | This can be your inbox or a subfolder, eg. "Inbox", "[Gmail]/All Mail", "my-newsletters", etc. |
debug | Prints out progress or any issues as it goes; for debugging only (defaults to false) |
delete_mail_after | Keeps the mail in the mailbox after processing (defaults to true) - note that subsequent requests will pick up the same email again |
Included Packages
With thanks to the following for these dependancies;
- https://github.com/mpdf/mpdf
- https://github.com/zbateson/mail-mime-parser
- https://github.com/swiftmailer/swiftmailer
Requirements
- php's IMAP library (eg. extension=imap.so) needs to be enabled in your php.ini file
Troubleshooting
- Ensure that your "kindleemail" address is correct as it appears on your Amazon account for receiving documents (see [Edit Your Send to Kindle Email Address](https://www.amazon.co.uk/gp/help/customer/display.html?ref=hp_left_v4_sib&nodeId=G7V489F2ZZU9JJGE))
- Ensure that your sending email address is permitted to send documents to your Amazon Kindle (see Add an Email Address to Receive Documents in Your Kindle Library)
Known Issues
- Due to the composition of emails, occasionally a block of style tags may be printed onto the end document. This is caused by external sources, such as includes / images, being pulled in after the email is parsed.
- At present the Kindle document appears in Amazon without an Author being populated, even though it's on the PDF. This seems to be caused on Amazon's side, when they convert the document.
All versions of newsletters-to-kindle with dependencies
mpdf/mpdf Version ^8.0
zbateson/mail-mime-parser Version ^2.2
phpmailer/phpmailer Version ^6.6