diff --git a/classes/emailcatcher.class.php b/classes/emailcatcher.class.php index ba87f26f5cf86a45643ae84cb82049945850abb1..54ca9a78b39ffdd67353939e86599dc253ba94c6 100644 --- a/classes/emailcatcher.class.php +++ b/classes/emailcatcher.class.php @@ -7,6 +7,7 @@ * * 👤 Author: Axel Hahn, Institute for Medical Education, University of Bern * 📄 Source: <https://git-repo.iml.unibe.ch/iml-open-source/php-emailcatcher> + * 📗 Docs: <https://os-docs.iml.unibe.ch/php-emailcatcher/> * 📜 License: GNU GPL 3.0 * * ---------------------------------------------------------------------- diff --git a/docs/30_Usage.md b/docs/30_Usage.md index f6ac5987b908d40ceddaa93d3eebe01eef980efa..a1e15d488818f7440a1d6a28438fa7519990843c 100644 --- a/docs/30_Usage.md +++ b/docs/30_Usage.md @@ -6,7 +6,16 @@ To browse emails and view each message open <http://localhost/vendor/emailcatche You see a list of emails. + + Click an email to view details of it including header and body. + + + +If an html email was selected then you get an additional button to preview as html. + + + If an html email was detected then you get an additional button to preview as html. ### Delete emails diff --git a/docs/_index.md b/docs/_index.md index 29a12899f840f887c613d5392d9eb60af2667f85..8a049ac14593beb171c818ec1a9513312a6da3a2 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -6,6 +6,6 @@ </html> 👤 Author: Axel Hahn; Institute for Medical Education; University of Bern \ -📄 Source: <https://git-repo.iml.unibe.ch/iml-open-source/php-emailcatcher> \ 📜 License: GNU GPL 3.0 \ -📗 Docs: <https://os-docs.iml.unibe.ch/__NAME__/> (see the docs folder so far) +📄 Source: <https://git-repo.iml.unibe.ch/iml-open-source/php-emailcatcher> \ +📗 Docs: <https://os-docs.iml.unibe.ch/php-emailcatcher/> diff --git a/docs/images/screenshot_list_emails.png b/docs/images/screenshot_list_emails.png new file mode 100644 index 0000000000000000000000000000000000000000..d2339fcea6a9c3202bad620ba8354edc4a95388b Binary files /dev/null and b/docs/images/screenshot_list_emails.png differ diff --git a/docs/images/screenshot_show_email.png b/docs/images/screenshot_show_email.png new file mode 100644 index 0000000000000000000000000000000000000000..9eaab5867aab5fa03b74a9ea864c2faf79a66e5d Binary files /dev/null and b/docs/images/screenshot_show_email.png differ diff --git a/docs/images/screenshot_show_html_email.png b/docs/images/screenshot_show_html_email.png new file mode 100644 index 0000000000000000000000000000000000000000..6fbf0cefe74eb2d6f901d4aef9c4496365e19312 Binary files /dev/null and b/docs/images/screenshot_show_html_email.png differ diff --git a/php-sendmail.php b/php-sendmail.php index ed2dc5bb1b6c0ab560d8c514ff00e80cae0b3042..6215edfb045f7339845b564c8eb493e601eedada 100755 --- a/php-sendmail.php +++ b/php-sendmail.php @@ -8,6 +8,7 @@ * * 👤 Author: Axel Hahn, Institute for Medical Education, University of Bern * 📄 Source: <https://git-repo.iml.unibe.ch/iml-open-source/php-emailcatcher> + * 📗 Docs: <https://os-docs.iml.unibe.ch/php-emailcatcher/> * 📜 License: GNU GPL 3.0 * * ---------------------------------------------------------------------- diff --git a/readme.md b/readme.md index 70cd235db1510046e9acf6662ecd300d23e48a56..9e66fb6664557d3214de066d3dfd271d5c29cce3 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,10 @@ A helper for a development environment: This PHP class fetches emails sent by ma Free software and Open Source from University of Bern :: IML - Institute of Medical Education -📄 Source: <https://git-repo.iml.unibe.ch/iml-open-source/php-emailcatcher> \ 📜 License: GNU GPL 3.0 \ -📗 Docs: TODO (see the docs folder so far) +📄 Source: <https://git-repo.iml.unibe.ch/iml-open-source/php-emailcatcher> \ +📗 Docs: <https://os-docs.iml.unibe.ch/php-emailcatcher/> + +## Screenshot + diff --git a/viewer.css b/viewer.css index fefa78c848ef2bbc1d5ce05f1dedb82275e96744..b8635977e03a8a675c512bc7f4ebbf4b7789c91a 100644 --- a/viewer.css +++ b/viewer.css @@ -97,13 +97,19 @@ pre{ width: 50%; border-bottom-left-radius: 2em; } -#singlemessage table{ +#singlemessage .header{ background-color: #cdc; background: linear-gradient(to right, #cec, #cee); width: 100%; padding: 0.5em; border-bottom: 4px solid rgba(0,0,0,0.05); } +#singlemessage table{ + width: 80%; +} +#singlemessage table td.small{ + width: 7em; +} #singlemessage .content{ padding: 0.5em; } \ No newline at end of file diff --git a/viewer.php b/viewer.php index ae44de36ed77eb4b363f30bc1cdaf2257632a953..63b6da62e158a1daf7258f2b93d76c8c22e214fe 100644 --- a/viewer.php +++ b/viewer.php @@ -7,10 +7,12 @@ * * 👤 Author: Axel Hahn, Institute for Medical Education, University of Bern * 📄 Source: <https://git-repo.iml.unibe.ch/iml-open-source/php-emailcatcher> + * 📗 Docs: <https://os-docs.iml.unibe.ch/php-emailcatcher/> * 📜 License: GNU GPL 3.0 * * ---------------------------------------------------------------------- * 2024-10-08 v0.1 initial version + * 2024-10-09 v0.1 add links * ======================================================================= */ require_once('classes/emailcatcher.class.php'); @@ -37,14 +39,14 @@ function showEmail($sId) $bIsHtml=strstr( $oMail->getBody(), '<html>'); $sReturn.= '<div id="singlemessage"> - <table> - <tr><td>🕜 DATE</td><td>'.$oMail->getField('date') - .'<span class="right"><a href="?" class="button close">❌ Close</a></span> - </td></tr> - <tr><td>👤 TO</td><td>'.$oMail->getField('to').'</td></tr> - <tr><td colspan=2><strong>'.$oMail->getField('subject').'</strong></td></tr> - </table> - <br> + <div class="header"> + <span class="right"><a href="?" class="button close">❌ Close</a> </span> + <table> + <tr><td class="small">🕜 DATE</td><td>'.$oMail->getField('date').'</td></tr> + <tr><td class="small">👤 TO</td><td>'.$oMail->getField('to').'</td></tr> + </table> + <strong>'.$oMail->getField('subject').'</strong> + </div> <div class="content"> 📜 Header:<br> <pre>'.$oMail->getHeader().'</pre> @@ -97,8 +99,8 @@ if(!count($aEmails)){ $sMessage=showEmail($sOpen); } + // show list of emails $sOut='Messages: <strong>'.count($aEmails).'</strong><br>'; - foreach($aEmails as $aEmail){ $sId=$aEmail['id']; @@ -132,8 +134,8 @@ echo "<!doctype html> <footer> Email catcher - 📄 <a href=\"\">source</a> - 📗 <a href=\"\">docs</a> + 📄 <a href=\"https://git-repo.iml.unibe.ch/iml-open-source/php-emailcatcher\" target=\"source\">source</a> + 📗 <a href=\"https://os-docs.iml.unibe.ch/php-emailcatcher/\" target=\"docs\">docs</a> </footer> $sMessage