Generating Email output

The Email context outputs HTML email with embedded formatting to an email client through the use of an email server. The HTML generated by this context is meant to be compatible with as many clients and as many devices as possible.

Email is sent in a single batch for the whole record set.

To test a template, you can send a test email first.

Output, generated from an Email template, can have the following attachments:

  • The contents of the Print context, in the form of a single PDF attachment. (Compression options for PDF attachments can be specified in the Email context's properties; see Compressing PDF attachments.)
  • Other files, an image or a PDF leaflet for example.

Attaching the Print context is one of the options in the Send (Test) Email dialog.

For more information see Email attachments.

Before generating Email output
  • Decide on the use of an Email Service Provider; see Using an ESP with PrintShop Mail Connect.
  • Make sure that a data set is loaded, that any necessary files, such as images and attachments, are in place, and that the correct settings are selected (see below).
  • You may want to rasterize certain elements, to ensure that most email clients would actually see the output. Rasterizing converts the element to a JPG or PNG image.
    To rasterize an element, right-click it and select Rasterize options. For a JPG image you can set the quality of the resulting image in a percentage.
    Rasterization options are only available for Boxes (<div> elements); see Boxes.
    A business graphic in an Email section is rasterized by default and output as PNG image, because email clients usually don't support SVG images.
    SVG images in an Email section give an error in the Preflight window (see Doing a Preflight).
  • For Email output, PNG is the preferred image format.
    EPS, PDF, SVG and TIFF images in an Email section are automatically converted to PNG to ensure that they can be seen in the email client. Note that this conversion does not take place when you select a specific page from a PDF or TIFF using a URL (e.g. 'images/PDF_20pages.pdf?page=3').

Email output settings in the Email context and sections

The following settings for the Email context and Email sections have an impact on how the actual emails are sent.

  • An Email To Script must be available in the template and refer to a valid email address; see Email header settings. If any record does not have a valid email, this record is skipped automatically when generating email output.

    When you send a test email, the Email To Script will not be used; instead, the email will be sent to the address that you specify in the Send Test Email dialog.

  • The sender(s), recipient(s) and the subject can be set using Script Wizards; see Email header settings.
  • Default SMTP settings can be set in the preferences; see Email header settings.
  • If there are multiple Email sections, only one of them can be merged with each record. Make sure that the correct section has been set as the default; see Setting a default Email template for output.
  • PDF attachments can be compressed to make the files smaller; see Compressing PDF attachments.

To generate Email output:

  1. Open a template with an Email context.
  2. Load a data file or database compatible with this template. See Loading data.
  3. On the File menu, click Send Email or Send Test Email. In the dialog that appears you can, among other things, attach the Print context or the Web context to the email. See Send (Test) Email for a description of all the options. Finally, click OK.
    About testing emails

    When you send a test email, the Email To Script will not be used; instead, the email will be sent to the address that you specify in the Send Test Email dialog. If you have a Litmus account, you can enter your Litmus test address. To make the test address appear by default, you can set the default test address in the Email Preferences: select Window > Preferences, click the arrow next to Email, click General and type the test address next to Email Test address.

    For a description of how to test your email for different email clients, see this how-to: Test your emails with Litmus. For more information on Litmus, please see http://litmus.com/

For a detailed description of how to use Mandrill with Connect to send and track emails, see the following how-to: Using Mandrill.

Aborting content creation

You may want the content creation process to be aborted in certain situations; for example, when a template script fails to load remote content. To abort the content creation process, you may raise a fatal error from within a script in the template; see fatalError(message).

When a script calls this function in Preview mode, the script that triggers it is marked with an error icon in the Scripts pane, and the given message is displayed in a hint.

When generating output from the Designer, the Designer will log the error and display an error dialog with the given message. Content creation is aborted.