This is documentation for the Howdy one-off and newslettering email announcement GUI, howdy_email_gui. The help output, when running howdy_email_notif-h, produces the following output,
usage: howdy_email_gui [-h] [--info] [--local] [--large] [--noverify] [--extraemails EXTRAEMAILS] [--extranames EXTRANAMES] {n,o} ...positional arguments: {n,o} Choose one of two options: (o) do only the email. (n) do the newslettering functionality. n Do the newsletter one. o Only do a straightforward email.optional arguments: -h, --help show this help message and exit --info Run info mode if chosen. --local Check for locally running plex server. --large If chosen, make the GUI (widgets and fonts) LARGER to help with readability. --noverify Do not verify SSL transactions if chosen.
The (n) choice means do a newsletter, while the (o) choice means do only the email. Here are the common arguments.
--local specifies that we look for a local (https://localhost:3400) running Plex server.
--large specifies that one should make the GUI (widgets and fonts) LARGER to aid in readibility.
--noverify is a standard option in many of the Howdy CLI and GUIs to ignore verification of SSL transactions. It is optional and will default to False.
When running with the (o) choice, this GUI only sends a non-newsletter email to either yourself or to all the friends of your Plex server. This GUI is launched when running howdy_email_gui--noverify--localo.
The main window has the following buttons and text fields. The subject and body fields go into their respective text areas.
The CHECKEMAIL button displays the rich HTML output of the email body, if there are no errors.
The SHOWPNGS button displays the PNG images located in your Imgur library. See, e.g., Section 2.3.2.1 to demonstrate its functionality.
There is a subject and body that you can specify. The email body is written in reStructuredText and then converted into HTML.
PLEXGUESTS displays the list of friends of your Plex server. See Fig. 8.1 for an example of what the friends of your Plex server looks like.
SENDTESTEMAIL only sends an email to yourself.
SENDALLEMAIL sends an email to you and all the friends of your Plex server.
Here we construct and send a rudimentary email that demonstrates an interesting amount of functionality available with reStructuredText. The work flow is ordered as follows,
Here, we write an email that consists of some stylized text, some LaTeX math, and an inset image with caption using our Imgur library. The subject of the email is test. The body is reStructuredText, and is given by,
I am showing some example code. Here is some *bold* code.
This is an inline equation, :math:`2x - 5y e^{-x} = 4`.
This is the `Black-Scholes equation`_.
..math::
\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2 S^2\frac{\partial^2 V}{\partial S^2} + r S \frac{\partial V}{\partial S} - rV = 0
Finally, one can insert an image into here. Here is what I will do.
..figure:: https://i.imgur.com/raP42Rz.png
:width: 100%
:align: left
Look at me! I have a caption!
.._`Black-Scholes equation`: https://en.wikipedia.org/wiki/Black–Scholes_equation
One can find some good tutorials on how to write valid reStructuredText online or on the Sphinx website. The biggest, undocumented subtlety here comes from adding images from our Imgur library – how do we know that the URL of the image is https://i.imgur.com/raP42Rz.png? We are looking for the HOWDY!EMAILGUI icon, which has a cowboy hat inside it.
First click on SHOWPNGS to pop up a table that shows the available PNG images in our Imgur library.
Second, right-click on the row that has howdy_email_gui_SQUARE.png, which will pop up a context menu. Select the Information context menu event to verify that we have the right image.
Third, we see that howdy_email_gui_SQUARE.png is the correct image, and we get its URL.
Finally, copy that email using the CopyImageURL context menu event.
After we have our URL copied and pasted, we click on CHECKEMAIL to pop up the rich HTML representation of the email body.
Furthermore, if the email body text is valid, then the buttons SENDALLEMAIL and SENDTESTEMAIL will be active. If the email body text is invalid, then those two buttons will be inactive.
Once you verify that your email is valid, you should check that your list of friends on your Plex server is valid. Just click on PLEXGUESTS to get the list of friends, one per row and ordered by name. First column is the full name, and the second column is the email address for their Plex account.
Once your email body text is valid, and you are satisfied that you may want to send this email out to people who have access to your Plex server, then you can click on either SENDTESTEMAIL (sends the email only to you) or SENDALLEMAIL (sends the email to all your Plex friends).
I always verify that the email is valid, by clicking SENDTESTEMAIL first, before sending the email to everyone.
When running with the (n) choice, this GUI only sends a non-newsletter email to either yourself or to all the friends of your Plex server. The Plex newsletter email has this format,
Hello <name>,<PREAMBLE PART><SUMMARY OF MEDIA ON PLEX SERVER><POSTAMBLE PART>
Here, <name> is the person receiving the email, <PREAMBLEPART> is an optional introductory section, <SUMMARYOFMEDIAONPLEXSERVER> summarizes the current media on the Plex server, and <POSTAMBLEPART> is an optional final section.
This GUI is launched when running howdy_email_gui--noverify--localn.
The CHECKEMAIL button displays the full rich HTML output of the email body, if there are no errors.
The PREAMBLE and POSTAMBLE buttons set up the <PREAMBLEPART> and <POSTAMBLEPART>, respectively. It is described in more detail in Setting up the PREAMBLE and POSTAMBLE parts.
PLEXGUESTS displays the list of friends of your Plex server. It has the same functionality described in Section 8.2.1.2.
EMAILDIALOG launches the email dialog window, where you select whether to send a test email or an email to all your Plex friends.
Just as in Section 8.2.1, here we describe the work flow to send a newsletter email.
8.2.2.1. Setting up the PREAMBLE and POSTAMBLE parts
Click on the PREAMBLE button to write up an introductory section in the newsletter, and the POSTAMBLE button to write up a concluding section. The PREAMBLE and POSTAMBLE dialog windows are nearly identical, and differ only in where the text is placed in the newsletter. Fig. 8.10 shows both together, but subsequent instructions focus only on describing the PREAMBLE.
Here, the reStructuredText of the introduction goes into the text box. The title of the introduction goes into the text label after SECTION. Toggle between the YES and NO radio buttons. If you want the introduction title in the newsletter email, choose YES; otherwise, choose NO.
Finally, test your introductory text by clicking on the TESTTEXT button. Its functionality is the same as described in checking email to see text in Section 8.2.1.1.
Fig. 8.12 and Fig. 8.13 show the rich HTML for the introductory and final sections, respectively. If the text is valid, then VALIDRESTRUCTUREDTEXT appears on the bottom left corner of the PREAMBLE and POSTAMBLE dialog windows.
After choosing the form of the introductory (Fig. 8.12) and final (Fig. 8.13) sections, click on CHECKEMAIL to (wait a long time and) show the rich HTML email of the Plex newsletter.
Although the email is too long to fit into the HTMLEMAILBODY window and the RENDEREDHTML tab, we first identify the Introduction section name for the PREAMBLE and the FinalThoughts section name for the POSTAMBLE. The Plex server summary part, in the middle is structured as follows.
SUMMARY is its title.
There are subsections on the Plex server’s music, movies, and television libraries collectively. For example, information on multiple music libraries are joined together.
Each section shows the current status of media on that type of library, in total and those media added after the date of the previous newsletter.
Furthermore, to aid in debugging, you can click on the RESTRUCTUREDTEXT tab in the HTMLEMAILBODY window to show the reStructuredText used to create this email. I have also included this examplerestructuredTextnewsletter to inspect, and independently verify, that it creates proper HTML.
Once your email body is valid (it generated HTML), and you are satisfied, that you may want to send this email out to people who have access to your Plex server, then you click on the EMAILDIALOG button to launch an email dialog. This dialog allows you to send the email only to yourself, to specific Plex friends, or to all your Plex friends and yourself.
The email dialog window starts with yourself on the top row. Subsequent rows are your Plex friends.
Once you have made your selection, click on SENDEMAIL to send the Plex newsletter emails to your group of selected friends and/or yourself. Just as in Section 8.2.1.3, I alway verify that the email is valid, by first clicking TESTEMAIL and then clicking SENDEMAIL, before sending the newsletter email to everyone.