Email Action

Previous  Next |  Direct link to this topic

The email action is a powerful action that allows you to send a Crystal Report via email (SMTP or MS Outlook) to one or multiple recipients.

 

[See a video of the feature]

clip0002

Field

Description

Subject

Here you type the subject of the email you want to send. You can use a fixed text or combine it with the dynamic syntax and/or one or more of the special keywords.

TIP: FOR FULL LIST OF SPECIAL KEYWORDS, PLEASE SEE APPENDIX 1

Preview email

Here you can choose to preview before you choose the send it

 

NB: DOES NOT WORK WITH MASS DELIVERY AND DUNNING WIZARD

Body Type

Here you choose if you want a plain text Email or an HTML Email. If you Choose HTML you need to write HTML in the Body Field

 

NB: Boyum can/will not offer help with writing the HTML syntax.

Body

Here you type the body of the email. Again, this can be a fixed text or combined with the dynamic syntax and/or one or more of the special keywords.

TIP: FOR FULL LIST OF SPECIAL KEYWORDS, PLEASE SEE APPENDIX 1

 

KEYWORDS

DateFormat(DynamicSyntax|FORMAT) can be used to format dates using a format.

 

Example:

 

 

DateFormat($[$10.0.DATE]|dd-MM-yyyy)

Will give:

31-01-2012

PLEASE NOTE: YOU NEED TO USE .DATE IN THE DYNAMIC SYNTAX

PLEASE NOTE: YOU CAN USE THE KEYWORD TODAY DATEFORMAT(TODAY|FORMAT) TO GET TODAY’S DATE

 

Formats available:

 

Format

Description

Example

d

Day without leading zero

5

dd

Day with leading zero

05

ddd

Day as text (shot)

Mo

dddd

Day as text (long)

Monday

M

Month without leading zero

9

MM

Month with leading zero

09

MMM

Month as text (short)

Sep

MMMM

Month as text (long)

September

yy

2-digit year

08

yyyy

4 digit year

2008

 

You can use the TimeFormat keyword to format a time:

TimeFormat(Time|Format).

Example:

TimeFormat($[SERVERTIME]|h:mm).

 

Formats available: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx (Or google Custom Date and Time Format Strings)

 

SQLHtmlTable(<sql>) this will if given a SQL create a HTML table with a header containing the name of the columns and create rows containing the values.

Example: SQLHtmlTable(SELECT CardCode, CardName FROM OCRD)

 

Tip: You can style the table using normal CSS. The class for table is: defaultTable.

 

Example (add borders to the table):

 

<style>.defaultTable, th, td {

border: 1px solid black;

}

</style>

SQLHtmlTable(SELECT CardCode, CardName FROM OCRD)

 

PLEASE NOTE: IT WILL MAKE A HTML TABLE SO YOU SHOULD SWITCH THE BODY TYPE TO HTML

 

SQL(<sql>) this will if given a SQL insert the first value returned by the SQL into the email body.

Example: SQL(SELECT Balance FROM OCRD WHERE CardCode = '$[$4.0.0]')

 

Tip: If you need to make a Right to Left email in B1 Print & Delivery (Hebrew and other) in HTML this can be done by adding the following DIV Style:<div style="direction: rtl;">CONTENT</div>. See a sample here

Attachment template

Here you choose the name of the report attachment. As you can see in the screenshot you have the option to use the SAP dynamic syntax (Example: $[$8.0.0] on a Sales order will give you the ordernumber).

TIP: FOR FULL LIST OF SPECIAL KEYWORDS, PLEASE SEE APPENDIX 1

Attachment type

Here you choose the attachment type. Supported attachment types are:

-         PDF

-         Excel

-         RTF (Rich Text Format)

-         Word

-         CSV

-         RTF (Editable)

-         Excel (Records)

-         Tab Separate Text (TTX)

-         Text (TXT)

-         HTML

-         XML

-         Word For Windows (RTF)

-         No Attachment (Will result in there being no attachment attached to the mail)

 

Please note: While this give you control over type, how each type are formatted is 100% controlled by the Crystal Report Export feature and we (Boyum IT) have no control over the export feature (we just call it in the Crystal Report API)

PDF protection

If you press the small shield (clip0003) button next to the additional attachments button you have the option to setup additional settings for the PDF format. Here you can define password protection and signing of the PDF document.

Additional attachments

You have the option to attach additional files to the emails.

To add additional attachments click the button and a new window will show:

image019

You can double click a cell to select a file and you have the option to use the SAP dynamic syntax. You can add a folder path and it will take all the files in the folder.

You have the option to ignore missing attachments. If an attachment is missing and this option is not set you will get an error and the mail will not be send.

The additional attachments also supports “SQL:” and “SQLMulti:” where SQLMulti: can be used to get multiple rows from a table.

 

You also have the option to compress the attachments to a zip file and give the file a name. The name field supports dynamic syntax.

 

Video: E-learning on for this feature works

 

Example: “SQLMulti:SELECT CAST(T1.trgtPath AS nvarchar(4000)) + '\' + T1.FileName + '.' + T1.FileExt FROM ORDR T0 JOIN ATC1 T1 ON T0.AtcEntry = T1.AbsEntry WHERE T0.DocNum = $[$8.0.0]” will attach all attachments on a Sales order to the email.

Recipients

In order to send an email you need to specify one or more recipients for the email. You can have as many recipients as you like by adding lines.

 

[See a video of the feature]

 

Column

Description

To / CC / BCC

Here you decide how the recipient will get the email. You can choose To, CC or BCC.

Email to use

Here you choose among predefined BP emails or direct emails (see below)

Type

 

BP: Default contact person

Use the email of the default contact person defined for the Business partner.

BP: Header

Use the email defined on the Business partner’s general tab.

Document: Selected contact person

Use the email of the selected document’s selected contact person.

(Can only be used when printing documents)

Does not work on the dunning wizard.

Email Category

Use all BP Contact persons that have the specified Email-category (see below)

BP Consolidation: Header

Use the Header email of the BP’s consolidation business partner.

BP Consolidation: Default Contact Person

Use the Default contactperson email of the BP’s consolidation business partner.

BP Consolidation: Email Category

Use all BP Contact persons that have the specified Email-category (see below) of the BP’s consolidation business partner.

BP Consolidation: Header (with fallback)

As “BP Consolidation: Header” but if no consolidation then it revert to “BP: Header”

BP Consolidation: Default Contact Person (with fallback)

As “BP Consolidation: Default Contact Person“ but if no consolidation then it revert to “BP: Default Contact Person”

BP Consolidation: Email Category (with fallback)

As “BP Consolidation: Email Category” but if no consolidation then it revert to “BP: Email Category”

Direct email

The direct email field can be used to send the report to a fixed email specified in the configuration. Also it can be used to send to custom emails using dynamic syntax if needed. The direct email supports “SQL:” and “SQLMulti:” where SQLMulti: can be used to get multiple rows from a table.

 

Sample: if you on a sales order have defined a user-defined field (called U_MAIL) to hold an email, you could set up a direct email to $[ORDR.U_MAIL.0] in order to send the sales order to the email specified in the UDF.

Email Category

Here you can choose the type of Email Category you wish to send to if you have set the “Email to use” to type “Email Category”. Email Category is defined on the Business Partner, Contact persons.

image021

 

As default there are no categories but from the contact persons you can define as many categories as you want.

 

Each contact person can be associated with up to 5 different e-mail categories for more complex e-mail configurations (Example: a contact person has primary category “Accounting” but is also “COO” as secondary category. All invoices should be sent to the accounting category while all COO’s need to be CC’ed on service calls. This would not have been possible with a single category and for that reason there are multiple).

Client delivery method

Here you decide if you wish to use Outlook, SMTP or Exchange to send the report from the client.

-         If you choose Outlook, you have the option to decide if the email should be generated as an outlook draft, draft + display of this draft or directly sent. There is also a fourth option to display as draft and add Outlook Signature. This option require email body to be HTML (if not it will work as the above option instead). Adding signature is only tested on Outlook 365 and might not work on lower Outlook versions.

-         image022

-         If you choose SMTP you need to choose one of the defined SMTP configurations. You can setup SMTP configurations by clicking the .. Button.

image023

image025

 

To change the user credentials for the SMTP you can double click and in the credentials column to open the change credentials window.

clip0008

 

-         If you choose Exchange, you need to choose one of the defined Exchange configurations. You can setup Exchange configurations by clicking the … Button.

            See how to setup and exchange configuration here

Use Personal Exchange

Here you can Choose to use your personal exchange if the Client delivery method is set to Exchange.

 

if personal exchange is activated each user will the first time they try to open a open the mass delivery widow or try to run a report action be shown a window where they are asked to input their user name and password  to the exchange.

 

if more than one exchange is configured the user will be asked for their login credentials to all the exchanges there are used by a report action.

 

Server delivery method

Here you decide if you wish to use SMTP or Exchange to send the report from the client.

-         If you choose SMTP you need to choose one of the defined SMTP configurations. You can setup SMTP configurations by clicking the … Button.

image028

image025

 

To change the user credentials for the SMTP you can double click and in the credentials column to open the change credentials window.

clip0008

 

 

 

-         If you choose Exchange, you need to choose one of the defined Exchange configurations. You can setup Exchange configurations by clicking the … Button.

            See how to setup and exchange configuration here

 

 

 

 

Group emails

Check this option to allow the system to group emails to the same recipient.

clip0001

Document level
If you have a sales document report and a specification report that are set up to be printed on a user-action, the system would be able to send both reports in one email instead of two. If grouping is possible the subject and body will always be used from the first configured email-action.

 
Business Partner level
If you have multiple document for example invoices that should be emailed to the same business partner, they will get grouped into one email instead of multiple. If grouping is possible the subject and body will always be used from the first configured email-action. It requires the recipients to be the same for all emails and that they are using the same configuration setup.
 

Business Partner level (With consolidation)

As above but the BP Matching will happen on the consolidating BP (or itself if no consolidation)

 

Business Partner level (Maximum grouping)

Will try to group emails more aggressively than "Business Partner level".
The requirements for this grouping logic is that the Business Partner and grouping level is the same. If the requirements are fulfilled the subject and body will be used from the first configured email-action. This option allows for grouping emails generated by Mass delivery.

 

Business Partner level (Maximum grouping - With consolidation)

As above but the BP Matching will happen on the consolidating BP (or itself if no consolidation)