File to Send Email from PanX is Available

Sometime ago, I claimed I’d try to put together a black box for email via Panorama X and Python. I’ve finally gotten it done. This would have been posted to the Database Exchange but there are two small files included, not one, so it isn’t accepted.

Download Mailbox, a utility database for use with Panorama X and Python 2.7 or later for sending email from Panorama X. OS X systems come with Python pre-installed, so typically there is no need to even concern yourself about it. Mailbox will just run.

Mailbox greatly simplifies the task of sending email directly from your Panorama databases and requires very little Panorama programming on your part. And while it can be used as-is, ideally you’ll use it as a starting point to build your own emailing system. See the built in help system for details.

Mailbox can send plain text email or HTML styled email. It can include embedded images or attached files. It can be used along with a Panorama database to perform data merges to send a single email message at a time or to loop through as many as you choose.

Although it’s delivered in a locked-down mode, access is freely provided on request.

1 Like

The Database Exchange does allow for uploading multiple files in a folder. Check out the special instructions at the bottom of the Uploading to the Panorama Exchange page.

Right you are Gary. Thanks, I did overtook that. It still required several tries after the validation worked because the Upload button remained disabled. Eventually I got the routine where the window close, then re-opened immediately with Upload enabled.

James, this is the simplest technique I’ve been able to come up with. It looks ridiculous but it works:

  1. Open the upload form and click in one of the uploaded databases in the left sidebar.
  2. Select Share>Add Database …
  3. Fill in the data boxes. DO NOT press Validate.
  4. Open or click in a Panorama X database, go to a procedure, remove and replace a character and save.
  5. Return to the upload window, click on Validate, then click on Close.

I have found that, without fail, the window closes and re-opens with the Upload button available.

Also, my recollection is that, if you have multiple files, the zip file must NOT have the same name as the Panorama X file.

Thank you Jim, this file is now available from the Panorama Database Exchange.

Mailbox provides for another way to send emails from Panorama X. One of the extended capabilities is its ability to send HTML formatted stylized text. Great.

The next hurdle was how to easily create the HTML text with readily available tools. My first thought was to use a 'Text Display Object but that used Rich Text. Then I thought to use Apple’s Mail program as it could easily create the colored, bolded, italiziced, variable font size text but alas while readily available, it wasn’t creating HTML.

What would be an easy path to allow a user to create HTML so that I could then capture that and use it for their emails? Something as easy as Mail, but with HTML that could be grabbed into a variable?

I have found this Online HTML Editor. Is there something others use or am I missing something that might allow all of this to be done within Panorama?

TextEdit gives you the option of saving as a web page. From there, fileload( can import the html source code.

1 Like

There is no WYSYWIG HTML tool in Panorama.

I tend to hand code HTML, HTML was not designed for WYSYWIG and tools that do this can generate some convoluted, bloated HTML code. That said, the Online HTML Editor you found looks pretty functional.

However, I will caution you that using HTML for email is a minefield. Email clients mostly support only a subset of HTML, and it’s different for each client. It’s kind of like going back to 1997 in terms of web standards. If you’re going to do anything beyond just bold, italic and links then you need to do a lot of research and testing. For example, CSS is completely out for most email clients.

There’s actually no need to get terribly involved with the HTML. You can do a lot using just simple tags - on the other hand, you can build a very complex page in DreamWeaver or another HTML editor and save it as a template.

The degree to which you style the message is entirely up to you but there is a lot you can do while keeping it simple.

I do a lot of direct email marketing for my photography and send a few hundred styled emails at a time. I’ve modified my copy of Composer to merge some data from my Contacts file and to loop through the selected names to send an email blast.

I’ve also got a procedure that converts line breaks to create opening and closing paragraph tags along with some other common items. You can invent your own tags to enter into the text then have a procedure change them to proper html tags too.

I send a file that looks like this via the Composer file included with the Python Mailbox:

<!DOCTYPE html>
<html lang="en">
<body link="blue" vlink="blue" bgcolor="#f2f2f2"> 
<font style="font-style: normal; font-size: 16px;" face="Optima" >
<blockquote>
<p>
Hi «Salutation»,
</p>
<p>This is <b>not</b> an appealing photograph.
</p>
<div align="center">
<img src="images/michigan/LakeinWinter/DSC05558.jpg"/><br />The Lake in Winter</div>
<p>
It was created on January 29, 2021 when Lake Michigan should have had a thick coat of ice stretching well beyond the shoreline towards the horizon. But in this winter, records were being set for lack of cold and snow - including a record low of 1.8% ice coverage on the Great Lakes which are normally at about 20% by the end of January.
</p><p>
The lakes are complex geophysical environments with many life forms dependent on them and their normal rhythms of seasonal temperatures. Lack of ice, for instance, diminishes the successful growth of diatoms that feed zooplankton that feed small fish that feed bigger fish and so on.
</p><p>
I've posted a slideshow, <a href="https://jamescook.biz/galleries/WestMichiganGallery.php#flr">The Lake in Winter</a>, a 14 year documentary of Lake Michigan at Oval Beach, consisting of images created during the same period of time in winter. It's interesting to see how this same view of the lake has compared over the years.
</p>
</div>

My best to you!
</br>
James Cook
</p><p>

Email: <a href = "mailto:Jim@JamesCook.biz">Jim@JamesCook.biz</a> <br />
Link to any of my web sites via: <a href = "http://saugatuckphotography.com">SaugatuckPhotography.com</a>  <br />

Represented in Saugatuck by <a href="http://www.goodgoods.com">GoodGoods</a>
</p><p>

<font size="-1">If you wish you can safely <a href="mailto:admin@saugatuckphotography?subject=Opt%20Out&amp;body=Remove me from your email lists">click here</a> to opt out of our email list. Or reply to this message with any minimal wording to let me know your desires and we will promptly eliminate you from our list of recipients.</font></font>
</p>
</blockquote>
</body>
</html>

It results in an email that looks like this:

Hi James,

Can your python solution run on Panorama X Server?

Also, I see there has been some discussion about html WYSYWIG. Here is a screen grab of how I am coding html with a preview in Panorama. It is a field with the html and a web browser object. Maybe it will help some one.

Absolutely, I’ve got variations working on the servers of several clients running on Enterprise 6 now. There’s no reason Pan X Server should treat it any differently.

It’s just a matter of calling it with the variables noted in its built in help. Or, crack it open and write your own connections.