ONYX - 9.0

Envoi de fichiers PDF par e-mail/en

De MappingDoc
Cette page est une version traduite de la page ONYX:9.0:Envoi de fichiers PDF par e-mail et la traduction est complétée à 99 %.

Autres langues :
English • ‎français

This documentation describes the function allowing PDF files to be sent by email (sending from an XPS file). This function is found in the workflow in the “Mail”, “Send PDF E-Mail” section.

Interface description

To access the interface for sending PDFs by e-mail, double click on the command in question, choose Mail then click on "Send May PDF"

OX S SNDPDFMAIL.png

Standard tab

OX S stdMail.png


To: This parameter allows you to enter the destination addresses Cc: This parameter allows you to enter the addresses in copy (OPTIONAL) Email subject: This parameter allows you to enter the subject of the email (OPTIONAL)


Note: Multiple recipients or copies can be entered, each separated by a semicolon. “; »


HTML BODY tab


OX S htmlbodyMail.png


This tab allows you to enter the body of the email to send.


Note: You can either type HTML directly or call an HTML file by typing the following syntax: FILE: C:\MyHtmlFile.html


XPS settings tab

OX S xpsparamMail.png


This tab allows you to enter the XPS file to be converted by PDF and sent by email Input file: This parameter allows you to specify the XPS file to convert to PDF and send by email Profile: This parameter allows you to specify an XPS to PDF conversion profile


Attachment tab

OX S attachmntMail.png



This tab allows you to enter the name of the attachment Attachment filename: This parameter allows you to specify the name of the attachment


Server options tab

OX S SRVMail.png



This tab allows you to enter the parameters of the SMTP server used for sending emails.

SMTP server: This parameter allows you to enter the IP address of the SMTP server or its DNS name SMTP domain: This parameter allows you to enter the domain name of the SMTP server SMTP port: This parameter allows you to enter the port number used for sending the email SMTP server login: This parameter allows you to enter the login used for connecting to the SMTP server SMTP server password: This parameter allows you to enter the password used for connecting to the SMTP server


Mail options tab

OX S mailoptions.png


This tab allows you to enter the sender of the email, the hidden copy (OPTIONAL), as well as the sending options (acknowledgment of receipt or read receipt)

  • From: This parameter allows you to enter the sender of the email
  • Bcc: This parameter allows you to enter the hidden copy(ies) of the email
  • Acknowledgment: This option allows you to request an acknowledgment of receipt (if checked)
  • Read receipt: This option allows you to request a reading receipt (if checked)

Note: Multiple blind copy recipients can be entered, each separated by a semicolon “; »


Mail tab format


This tab allows you to enter the body of the email in Text mode (and not HTML), the footer of the email (in HTML mode or in Text mode)


  • Body text: This parameter allows you to enter the body of the email in text mode (no formatting)
  • HTML footer: This parameter allows you to enter the footer of the email in HTML mode (write directly from HTML)
  • Text footer: This parameter allows you to enter the footer of the email in text mode (no formatting)


Note: You can either type HTML directly or call an HTML file by typing the following syntax: FILE: C:\MyHtmlFile.html

Examples

Variant 1: Sending email with attachment name and email body in plain text

Let's take the following workflow as an example:

The “Send PDF mail” box must absolutely receive an XPS file. Any other file will be refused and an error will appear in the logs.


The box parameters are:

OX S variante envoie de mail.png


The file sent is the file received by the “MAP_FILE_IN” environment parameter box, it is entirely possible to put a hard file (for example: C:\MyFichier.xps). In this example, the input file would then only serve as a trigger.

OX S variante1.2.png


Since it is a PDF sending box by email, there is no need to specify the name of the extension, a PDF will automatically be included in the email.

OX S variante1 mailopt.png


  • This action sends an email to “jdieu@mappingsuite.com” on behalf of “jdieu@mappingsuite.com” with an attachment MyAttachment.pdf and for body:


This is my first line of my email body

This is my second line of my email body

This is my third line of my email body


Variant 2: Sending email with variable attachment name and email body in plain text

In this example, we send an email with an attachment having a dynamic name equal to the name of the input file received by the rules engine, and a dynamic body having the name of the attachment on it.


In this example, the file sent to the workflow is called Attachment_jerome.xps


Let's take the following workflow as an example:


OX S variante2MAIL.png


A) “Parameter” action: FILENAME_TEMP


This action allows you to initialize a variable with part of another variable.


Here we:


  • Let's create a variable: FILENAME_TEMP
  • Let's initialize this variable with the basename of the MAP_TITLE variable


(ex: MAP_TITLE: C:\Repertoire\attachment_Jerome.xps -> The basename is: attachment_Jerome.xps)


In our example, the value of FILENAME_TEMP is Attachment_Jerome.xps

B) “Parameter” action: FILENAME The goal of this 2nd box is to have a variable (here FILENAME) equal to “Attachment_Jerome” and not “Attachment_Jerome.xps” and then use it.

Here we:


  • Let's create a variable: FILENAME
  • Let's initialize this variable with the part of the FILENAME_TEMP up to the point


In our example, the FILENAME value is “Attachment_Jerome”. We will use this FILENAME variable to name the attached file and indicate it in the body of the Mail.

C) “Parameter” action: Send_PDF_mail

This action allows you to send the Email.


Here we name the attached file with the variable FILENAME (here in blue: Corresponds to a parameter and not to a hard value) Note: It is possible to call a variable by indicating [%, and this time in VALUE mode (black text).


In our example, the parameter would be:

OX S variante2.1Mail.png


In this case, we are mixing hard text with a variable. Therefore the variable must absolutely be specified with [% because we cannot mix PARAM values ​​(blue) with VALUE values ​​(black)


Variant 3: Sending email with attachment name coming from an index in the input XPS file

In this example, we send an email with an attachment having a dynamic name equal to a value of an index present in the XPS file, and a dynamic body having the name of the attachment on it.

In this example, the sent file has an index called IDX_QNUFAC with the value 00057109

Let's take the following workflow as an example:

OX S variante3Mail.png


A) “Parameter” action: INDEX_VALUE


This action allows you to initialize a variable with the value of an index present in the XPS file received as input.


OX S indexval.png



Here we:

  • Let's create a variable: INDEX_VALUE
  • Let's initialize this variable with the first value of the IDX_QNUFAC index found in the XPS file (here 00057109)


In this example, the value of IDX_QNUFAC is “00057109”


B) “Parameter” action: Send_PDF_mail

This action sends the email.

OX S sndpdfmail b.png


Here we name the attached file with the variable FILENAME (here in blue corresponding to a parameter and not to a hard value).


Note: It is possible to call a variable by indicating [%, and this time in VALUE mode (black text).

In our example, the parameter would be:

OX S sndpdfmail b2.png


Variant 4: Sending email with a variable destination address

The method is the same as for the variable attachment name.

OX S SNDMAILvariante4.png



You must initialize a variable with the value of the email address and use it in the tab.


Here the variable “EMAIL_TO” is initialized with the value of the index of the input XPS file “IDX_EMAIL”


OX S SNDMAILvariante4.1.png

Then, its value is used in the “Send PDF mail” box.

OX S SNDMAILvariante4.2.png


In this case, we are mixing hard text with a variable. Therefore the variable must absolutely be specified with [% because we cannot mix PARAM values ​​(blue) with VALUE values ​​(black)


Variant 5: Sending an email with a Body and a Footer

This variant allows you to send a PDF by email by specifying a BODY and a FOOTER. To do this, you must use the body from the 2nd tab “HTML Body”. The Html Body of the “Mail format” tab is not taken into account.


1) First, let's specify the destination address and subject of the email:


OX S sndmailbdy.png



2) Next, let's specify the value of the body of the email:


OX S sndmailbdy1.png



To add line breaks, you must add the value <br>, a simple return to the line (Enter key) does not work. You can also specify an HTML body with an HTML file (see example below).


3) Next, let's specify the value of the footer:


OX S sndmailbdy2.png



To add line breaks, you must add the value <br>, a simple return to the line (Enter key) does not work. You can also specify an HTML body with an HTML file (see example below).

Note: If the “HTML body” and the “Body text” of the “Mail format” tab are both entered, only the “HTML body” will be taken into account.


Variant 6: Sending an email with an HTML body calling an external HTML file

This variant allows you to send a PDF by email containing an HTML body coming from an external HTML file. The biggest advantage of this option is that the HTML file can be generated and managed by a person outside Mapping (an HTML specialist for example and not a MAPPING specialist). Modifying the HTML file will have the effect of automatically modifying the content of the email sent by MAPPING, without affecting the processing rules.

1) First, let's specify the destination address and subject of the email:


OX S sndmailHTML.png


2) Next, let's specify the body value of the HTML body via an external HTML file:

OX S sndmailHTML1.png


You can also specify an HTML body with an HTML file (see example below).


3) Next, let's specify the value of the footer:



Note : We can also put dynamic data in the HTML file using the [[ ]] syntax for indexes or [% %] for environment variables. Example: Hello Mr [%NAME%],


Variant 7: Sending an email with an HTML body calling an external HTML file with variable data

This variant allows you to send a PDF by email containing an HTML body coming from an external HTML file. This HTML file contains dynamic values ​​coming from indexes of the input XPS file and parameters initialized via data from the input file or other.


Consider the following workflow:


OX S variante7.png


1) For our example, let’s create and initialize an environment variable “NAME” with the value “Jérôme DIEU”


OX S variante7.1.png


2) For our example, let's create and initialize an index "INVOICE" with the value "INV_2018050001


OX S variante7.2.png


3) Let's convert and send the PDF using the HTML file having the content as below:

Dear [%NOM%],


Please find enclosed your invoice N°[[INVOICE]]

Best regards


Here is the call for the HTML file:

OX S variante7.3.png


The received email has the content of the HTML file as body.


Variant 8: Sending an email with an HTML body calling a dynamic external HTML file based on a company code

This variant allows you to send a PDF by email containing an HTML body coming from an external HTML file. This HTML body is variable and is based on the company code received in the input file.

Consider the following workflow:


OX S variante8.png


1) For this example, you must have 2 HTML files, an HTML file for company 1 (COMP1.html containing the logo of company 1 for example and other information unique to this company 1) and another HTML file for company 2 (COMP2.html containing the logo of company 2 other information unique to this company 2)

2)For our example, let's create and initialize an environment variable "COMPANY_ID" with the value of the company code (coming for example from the input file via a rulefile): In our example, I hard initialize it to "COMP1 »


OX S variante8.1.png


3)Next, let’s create and initialize an environment variable “NAME” with the value “Jérôme DIEU”


OX S variante8.2.png



4)For our example, let's create and initialize an index "INVOICE" with the value "INV_2018050001"

Here is the call for the HTML file The email received has the content of the HTML file as body


OX S variante8.3.png


5)Let's convert and send the PDF using the HTML file having the content as below:

OX S variante8.4.png


Here the HTML file is called dynamically according to the COMPANY_ID value.

Notes

1) It is possible to enter several recipients in blind copy with each address separated by a semicolon “; ".


2) If the “HTML body” and the “Body text” of the “Mail format” tab are both entered, only the “HTML body” will be taken into account.

3) To write a body you must use the HTML body (present in the second tab), if you use the “Body text” from the “Mail format” tab, the body will be absent.