Integrated eMail Support

Using Omni Automation you can construct and manipulate outline documents, apply styles and import data from a variety of sources. And with integrated scripting support for creating and sending email, it becomes easy to automate the sending of outline content and documents. The following documentation demonstrate how to access and use this ability, beginning with a set of parameters for generating an email.

Constructor

Omni Automation in OmniOutliner supports an Email class, design for creating and sending electronic mail messages. To instantiate an instance of this class, it is preceded by the new constructor.

Instance Properties

As with most scriptable objects, an instance of the Email class has properties that define its design and usage. Here is the list of properties for this class:

Instance Functions

The Email class contains a single command generate() for processing instances of the class.

var email = new Email() email.subject = "Contents of “" + document.name + "”" email.body = "Whatever content you wish to include" email.generate()
omnioutliner://localhost/omnijs-run?script=try%7Bvar%20email%20%3D%20new%20Email%28%29%0Aemail%2Esubject%20%3D%20%22Contents%20of%20%E2%80%9C%22%20%2B%20document%2Ename%20%2B%20%22%E2%80%9D%22%0Aemail%2Ebody%20%3D%20%22Whatever%20content%20you%20wish%20to%20include%22%0Aemail%2Egenerate%28%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D

The following are examples of creating and sending mail messages whose contents are derived from the current outline document.

Send Basic Text of Outline

As an example of an Omni Automation action that creates an outgoing mail message containing the contents of the current OmniOutliner document as plain tabbed text:

NOTE: On iOS and iPadOS leading spaces and tabs may be stripped from the message body.

[see Export Outline page for details regarding FileWrappers]

/*{ "type": "action", "targets": ["omnioutliner"], "author": "Otto Automator", "identifier": "com.omni-automation.oo.send-outline-as-text", "version": "1.0", "description": "This action will create a new outgoing email message whose contents is the outline as plain text with tab indents.", "label": "Send Outline as Text", "shortLabel": "Send as Text" }*/ (() => { var action = new PlugIn.Action(function(selection, sender){ // action code // selection options: columns, document, editor, items, nodes, outline, styles var baseName = document.name var fileTypeID = "public.plain-text" wrapperPromise = document.makeFileWrapper(baseName, fileTypeID) wrapperPromise.then(function(wrapper){ var email = new Email() email.subject = "Contents of “" + document.name + "”" email.body = wrapper.contents.toString() email.generate() }) wrapperPromise.catch(function(err){ console.error(err.message) }) }); action.validate = function(selection, sender){ // validation code // selection options: columns, document, editor, items, nodes, outline, styles return true }; return action; })();
mail-message-with-tabbed-text
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER