Publishing Framework
Publish to E-mailPublishes a package using the e-mail transport. SyntaxCALL PACKAGE_PUBLISH(packageId, publishType, rc, properties, <propValue1, ...propValueN> , address1<, ...addressN>);
DetailsDefault BehaviorWhen publishing to e-mail, the e-mail message is sent in plain text format by default. Only inserted reference entries are published to e-mail. For details about inserting reference entries, see the INSERT_REF CALL routine. The package description field precedes the reference value in the e-mail message. All other entries that are inserted into the package are ignored. To override the default behavior, you can specify the ARCHIVE_PATH, COLLECTION_URL, PARENT_URL, TEXT_VIEWER_NAME, or VIEWER_NAME properties. Note: If the mailer is not running in a Windows NT operating environment, you will be prompted for the mail profile to use when you send the e-mail message. To avoid being prompted, specify the EMAILID and EMAILPW options at SAS invocation. For example: sas -EMAILID "Microsoft Outlook" Archive Path PropertiesIf you specify the ARCHIVE_PATH property, an archive is created and published as an e-mail attachment. All entries that are inserted into the package are published as an archive. If you specify a value for ARCHIVE_PATH, the created archive is stored at the designated location. To create a temporary archive that is deleted after the package is published, specify an ARCHIVE_PATH value of "" or "tempfile". If you specify ARCHIVE_PATH as an LDAP URL, an FTP URL, or an HTTP URL, see How to Specify an ARCHIVE_PATH for details about archive properties. Note: In order to create an archive under the z/OS operating environment, the z/OS environment must support UNIX System Services directories. If you specify the PROCESS_VIEWER property (with either the VIEWER_NAME or TEXT_VIEWER_NAME property) along with the ARCHIVE_PATH property, the archive is created but is not sent as an attachment in e-mail. Instead, viewer processing occurs and the rendered view is sent in e-mail. For more information about the application of viewer properties, see Viewer Processing. When publishing to an archive with the e-mail transport, you can specify the following archive properties: ARCHIVE_NAME, ARCHIVE_PATH, FTP_PASSWORD, FTP_USER, HTTP_PASSWORD, HTTP_PROXY_URL, HTTP_USER, LDAP_BINDDN, or LDAP_BINDPW. Viewer PropertiesIf you specify the VIEWER_NAME or TEXT_VIEWER_NAME property, the viewer is used to create the e-mail message and to apply substitutions. VIEWER_NAME renders the view in HTML format. TEXT_VIEWER_NAME renders the view in text format. Only the package information that is rendered by the viewer is published. If you specify the PROCESS_VIEWER property (with either the VIEWER_NAME or TEXT_VIEWER_NAME property) along with the ARCHIVE_PATH property, the archive is created but is not sent as an attachment in e-mail. Instead, viewer processing occurs and the rendered view is sent in e-mail. WebDAV PropertiesIf you specify the COLLECTION_URL property, the package is published to the specified URL on a WebDAV-compliant Web server. An example of a collection URL is http://www.host.com/AlphaliteAirways/revenue/quarter1. The collection is named quarter1. The e-mail message that is sent to subscribers will contain a reference to the URL that is specified in the COLLECTION_URL property. The PARENT_URL property is similar to the COLLECTION_URL property except that it specifies the location under which the new WebDAV collection is to be placed. The PUBLISH_PACKAGE CALL routine generates a unique name for the new collection. The unique name is limited to eight characters, with the first character as an s. An example of a parent URL directory location is http://www.host.com/AlphaliteAirways/revenue. An example of a collection name that is automatically generated might be s9811239. The e-mail message contains a reference to the collection, which is URL that you specified in the PARENT_URL property. The specifications of COLLECTION_URL and PARENT_URL are mutually exclusive. When publishing to a WebDAV-compliant server with the e-mail transport, you can specify the following WebDAV properties: HTTP_PASSWORD, HTTP_PROXY_URL, HTTP_USER, IF_EXISTS, TARGET_VIEW_MIMETYPE, TARGET_VIEW_NAME, and VIEWER_NAME (or TEXT_VIEWER_NAME). WebDAV publishing uses the following file extensions for each item type:
ExamplesExample 1The following example publishes a package to three e-mail addresses. Because no properties are specified, the e-mail message will contain only inserted references and will be published in plain text format.pubType = "TO_EMAIL"; properties=''; CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, "user1@alphaliteairways.com", "John Smith", "jsmith@alphaliteairways.com"); Example 2The following example publishes a package to one e-mail address and designates text for the subject line of the message:pubType = "TO_EMAIL"; subject = "Nightly Builds Update"; properties="SUBJECT"; Addr = "admins-l@alphaliteair03.vm.com"; CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, subject, Addr); Example 3The following example publishes a package to two e-mail addresses and designates the viewer to be used when formatting the e-mail message. The e-mail message will contain only content that can be rendered in a view. The rendered view is deleted after it is published. In order to save the rendered view explicitly, you can specify the APPLIED_VIEWER_NAME property and a file name value. pubType = "TO_EMAIL"; properties="SUBJECT, VIEWER_NAME"; subject = "Nightly Build Updates"; viewer = "filename:template.html"; Addr = "admins-l@alphaliteair03.vm.com"; CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, subject, viewer, "buildmonitor@alphaliteairways.com", Addr); Example 4The following example uses the ARCHIVE_PATH property to publish an archive as an e-mail attachment. All entries in the package are contained within the archive.pubType = "TO_EMAIL"; properties="ARCHIVE_PATH"; apath = "/u/users1"; Addr = "admins-l@alphaliteair05"; CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, apath, Addr); Example 5The following example uses the e-mail transport to publish a collection URL on a WebDAV-compliant server. The HTTP user ID and password enable the publisher to bind to the secured HTTP server. All e-mail recipients who are members of the mail list receive the e-mail announcement that the best rates are accessible at the specified URL. pubType = "TO_EMAIL"; properties="COLLECTION_URL, SUBJECT", "HTTP_USER", "HTTP_PASSWORD"; collurl="http://www.alphaliteairways/fares/discount"; subj="Announcing Best Rates Yet"; http_user="vicdamone"; http_password="myway"; Addr = "admins-l@alphaliteair05"; CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, collurl, subj, http_user, http_password, Addr); Example 6The following example specifies e-mail addresses that are stored in a variable in a password-protected SAS data set. pubType = "TO_EMAIL"; properties = "SUBJECT, ADDRESS_DATASET_LIBNAME, ADDRESS_DATASET_MEMNAME, ADDRESSLIST_VARIABLE_NAME, DATASET_OPTIONS"; subject = "Get out and Vote!"; lib = "voterreg"; mem = "northeast"; var = "emailaddr"; opt = "pw='born2run'"; CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, subject, lib, mem, var, opt); |