Export Form Email Tool

The Export Form Email Tool in Joget DX enables users to send an email with a PDF attachment of a form. This tool integrates with Joget's email plugin to facilitate sending emails with customizable PDF attachments generated from form data.

Apart from configuring the normal email plugin, the only other configuration you will need to do is select the attached form and the desired file name for the PDF attachment.

You can also use the Export Form Email Tool in Post Form Submission Processing to send out an email when the user submits the form on:

  • Data creation, or
  • Data update, or
  • Both Data creation and Data update.

Configure export email

To configure Export Form Email, drag and drop the Tool element onto the canvas in Process Builder,  click on it, and select Mapping.

When adding Export Form Email in the field Tools, you will see the following fields available for configuration:

  • Form: Select the form whose data will be used to generate the PDF attachment.
  • File Name: Specify the desired name for the PDF attachment.
  • Hide fields without value: When checked, fields without input will be omitted from the generated PDF.
  • Show unselected options for multi-options field: When checked, unchecked options in elements like Select Boxes or Radio Buttons will appear in the generated PDF.

Email info

The Email Info section provides configuration options for specifying email recipients and content. Users can define recipients using specific email addresses or participant IDs, include CC and BCC addresses, and customize the email subject and message. Additionally, users can choose to format the email content as HTML for a richer presentation.

Fields to configure:

  • To (Specific email address): Enter the recipient's fully qualified email address.
  • To (Participant ID): Participant ID(s) according to its process flow. Multiple values can be accepted by separating them with semicolons.
    When To (Specific email address) and To (Participant ID) are populated, email will be sent to both.
  • CC: Fully qualified address is expected. Multiple values can be accepted by separating them with semicolons.
    CC: lets you send a copy of a message to someone who's interested, but is not the primary recipient.
  • BCC: Fully qualified address is expected. Multiple values can be accepted by separating them with semicolons.
    Both Cc and Bcc forward a copy of the message to everyone you've listed. The main difference between Cc or Carbon copy and Bcc (Blind carbon copy) is that, with the latter, the recipients do not get to know each other.
  • Subject: Enter the subject line for the email.
  • Message: Type the email message here.
  • HTML Content?: Check if the Message is intended to be HTML content.

Email - SMTP settings

The Email SMTP Settings allows users to configure the SMTP server settings for sending emails. Joget will use the default SMTP configuration from the General Settings if left empty. Users can specify the sender's email address, SMTP host, port, and security type and provide authentication details such as username and password. This ensures that emails are sent securely and reliably.

If you leave the SMTP settings below empty, Joget will read the default SMTP configuration values from the General Settings > SMTP Settings page.

Fields to configure:

  • From: Sender's email address. (e.g., no-reply@your-company-name.com).
  • SMTP Host: Email server SMTP host (e.g., smtp.gmail.com).
  • SMTP Port: Email Server SMTP Port.
    Typically, port 465 is for the SSL security option, and 587 is for TLS.
  • Security: Choose between None, TLS, or SSL.
    Alternatively, you can click on the hash symbol to allow the input of hash variables.
  • SMTP Username: Email server account username.
  • SMTP Password: Email server account password.

Digital signature

The Digital Signature section provides options to digitally sign the PDF attachments generated by the Export Form Email Tool. Users can specify the file path of the keystore file (P12), the keystore's passphrase, and the digital certificate's issuer alias. Digitally signing PDFs enhances the authenticity and integrity of the documents.

Fields to configure:

  • Key Store File Path (P12): File path of the .pfx or .p12 file under the wflow folder in your Joget DX installation folder.
  • Key Store Passphrase: Passphrase for the .jks file.
  • Issuer Alias: The digital certificate's or signature's Issuer name (alias).

Error handling

The Error Handling allows users to define the behavior when email sending fails. Users can specify the number of retries and the interval between retries. A quick test option is also available to validate and test email settings immediately, ensuring the email configuration is correct and functional.

Fields to configure:

  • Number of Retries When Fail to Send Out Email: Number of retries when the email fails to be sent.
  • Retry Interval (Seconds): Frequency of retries in seconds.
Quick Test
Hit the Send Test Email button to quickly validate and test your email settings.

Advanced

The Advanced provides additional customization options for generating PDFs. Users can include custom CSS for formatting, define headers and footers in HTML, and choose to repeat them on every page. This section also allows embedding images in emails and specifying file attachments with various types and paths. These options offer extensive control over the appearance and content of the generated PDFs and emails.

Fileds to configure:

  • Formatting (CSS): CSS to be included when generating pdf files.
    The Advanced > Formatting (CSS) field gives you formatting options (font size and color) for the output. 

    Available CSS Classes:

    *
    - Wildcard. Everything in the form.
      
    .form-section
    - Container of a section
      
    .form-section-title
    - Container of section title
      
    .form-column
    - Container of column
      
    .form-cell
    - Container of field
      
    .label
    - Label of field
      
    //Sub Form
    .subform-container
    - Container of a Subform
      
    .subform-title
    - Container of Subform title
      
    .subform-section
    - Container of section in Subform
      
    .subform-section-title
    - Container of section title in Subform
      
    .subform-column
    - Container of column in Subform
      
    .subform-cell
    - Container of field in Subform
      
    .header
    - Container of configured header
      
    .footer
    - Container of configured footer
    

    //Change all word to blue color
    *, .form-cell{
      color:blue;
    }
      
    //Change all word to smaller size
    *, .form-cell{
      font-size:10px;
    }
      
    //Change all label format to underline
    .label{
      text-decoration:underline;
    }
      
    //Transform all header format to uppercase
    .form-section-title{
      text-transform:uppercase;
    }

    Font & Unicode 
    There are a few fonts (added by default) that you can use in CSS formatting:

    serif, sans-serif, monospace, Courier, TimesRoman
    For Unicode content, you can use the following fonts for Asian languages (i.e., Chinese, Traditional Chinese, Japanese, Korean):
    STSong-Light, MSung-Light, HeiseiMin-W3,  HYGoThic-Medium
    Note:
    STSong-Light
     gives the best result for Chinese, MSung-Light for Traditional Chinese, HeiseiMin-W3 for Japanese, and HYGoThic-Medium for Korean.
    *{font-family:HYGoThic-Medium;}

    Example for adding non supported font:

    • Method 1: Add the following CSS into Export Form Email Tool > "Formatting (CSS)" field:

      @font-face {
          src: url(http://localhost:8080/THSarabun.ttf);
          -fs-pdf-font-embed: embed;
          -fs-pdf-font-encoding: Identity-H;
      }
      *{font-family: 'TH SarabunPSK';}

      Download the THSarabun.ttf font file and copy it to the [Tomcat Directory]/webapps/ROOT folder.

    • Method 2: From Joget v6.0.16, it now supports adding additional font for datalist pdf export and FormPdfUtil by adding the font file to folder /wflow/fonts directory and configure the font in fonts.csv file in the same directory with format font family name, file name, encoding. For the sample, kindly refer to the fonts.csv file.
  • Header (HTML): Header in HTML to be included when generating PDF files.
  • Repeat header on every page?: If checked, the Header (HTML) will be included in every subsequent page in the generated PDF file.
  • Footer (HTML): Footer in HTML to be included when generating PDF files.
  • Repeat footer on every page?: If checked, the Footer (HTML) will be included on every subsequent page in the generated PDF file.

Attachments

The Attachments allow users to configure file attachments for the email. Users can select the source form and specify file upload fields, including the option to embed images in the email. Additionally, users can define custom file paths or URLs for attachments, ensuring flexibility in attaching relevant files to the email.

Fields to configure: 

  • Form: File attachment source form.
  • Form Upload Fields:
    • Field ID: File attachment field ID(s) in the Form selected above.
    • Embed: Click the checkbox to embed the image attachment in the email and display the image using HTML, for example, <img src="cid:#form.table.FileUpload?url#" />.
  • Files: This attribute allows one to define the file attachment freely by defining a system path or absolute URL.
    • Path: Source file path & filename.
    • Type:
      • System Path
      • URL
    • File Name: File name to be used in the email attachment.
    • Embed: Click the checkbox to embed the image attachment in the email and display the image using HTML, for example, <img src="cid:cat.jpg" />.
      See Send List as Attachment in Email Tool for more information.

ICS attachment

The ICS Attachment provides options to attach an ICS file to the email, allowing recipients to quickly add events to their calendars. Users can define event details such as name, start and end times, date format, timezone, description, location, organizer email, and attendees. This feature is useful for sending calendar invitations and ensuring recipients can easily schedule events.

Fields to configure:

  • Attach ICS File

    Check this option to prepare an event and attach it as an ICS file in the email.
    When this attribute is checked, the details for the calendar ICS file must be filled in in the fields below.

    Important:
    The organizer or sender email must not be the same as your destination/recipient email. If sender and recipient emails are the same, you will not see the "Add to calendar" box in your email.

Additional resources

You can find links to related articles and tutorials that provide further guidance and information on using the Export Form Email Tool and associated features. These resources can help users understand best practices, explore advanced configurations, and leverage the full potential of Joget's email and PDF generation capabilities.

Created by Julieth Last modified by Aadrian on Dec 13, 2024