Send documents directly from Business Central uscing a customized setups.
Module Description
This module allows you to make default settings for sending documents by email.
The information that can be entered is:
- Different recipients for each document type on the customer or supplier database
- Texts for the subject and body of the email, generic for each type of document or dedicated to a single customer / supplier
- Default attachments, in addition to the PDF of the document, automatically attached, for all shipments of a certain type of document or set for a single email shipment
When sending the email from the document the default settings can be changed.
This documentation focuses on the active side, but the functionality is mirrored on the supplier side.
Setup
Email Account
In order to send emails correctly, you need to set up all your sending email accounts.
You then need to open the Email Accounts page from the menu:
Here you need to enter all the senders that can be used (in subsequent setups) for sending mail with the related server settings:
* Warning, it is always necessary to first perform a system analysis on the client's mail server infrastructure to understand how best to perform the setup
Recipients with contact management
By opening the customer profile, it is possible to indicate which contacts are recipients of the emails for each type of document.
Then select Related – Customer – Link email to contacts :
A page will open showing all the contacts linked to the selected customer with their email addresses.
Using the flags on the right you can then select the recipient of the email for each type of document:
For each document type it is also possible to indicate more than one recipient, these will be automatically linked.
This selection will automatically populate the Doc Mail Addresses table:
Here you can indicate any CC and BCC or identify different recipients for different shipping addresses (for example for shipments).
Recipients without contact management
In case the contact records are not managed, it is possible to directly manage the recipient addresses, CC and BCC directly in the Mail Doc. Addresses table present in the customer records:
Here you can indicate:
-
Table ID: indicates the document table from which the email starts
36 à provisional sales documents
38 à provisional purchase documents
110 à recorded sales shipping
112 à registered sales invoice
114 to registered sales credit note
6650 à Registered purchase return shipments -
Document type: to be indicated only for provisional documents (tables 36 and 38).
0 on offer
1st order
2nd invoice
3 to credit note
4th scheduled order
5th return order - From Address: sender of the email (see Paragraph 2.5 )
- Send to: recipient of the email, if there is more than one you can insert all the addresses with a ; for concatenation
- Send CC: email addresses in carbon copy, here too you can concatenate more than one address
- Send BCC: blind carbon copy email addresses, here too you can chain more than one address
-
Ship to / Order Address Code: In case the recipients are different based on the shipping address, you can indicate it here.
Setup mail text Notification
The default email body and subject text settings are to be made in the searchable Notification Text Mail Setup list in the menu.
For each type of document for which you want to manage email sending, you need to insert a line within this setup, maintaining the same logic described in paragraph 2.3 .
The fields to be indicated are:
- Table ID: indicate the header of the document to be sent.
- Table subtype: for temporary documents it is also necessary to indicate the document type
- Customer / Supplier: indicate whether the management is related to a customer or supplier
-
Customer/Supplier No.: in case you want to manage a different setup for each customer, you can insert multiple lines for the same document type by indicating the specific customer code in this field. If the field is left blank, the setting will be considered the default one.
The setup with the specific anagraphic data will always prevail over the default one. - Notification Text Code: Indicates the text for the subject and body of the email
- setup report: you can indicate a print template for the report of the sent document.
-
Sender email: indicate any sender for the specific document / personal details
Notification texts
To enter a notification text, search the list from the menu or go to the Setup Mail Notification Texts list field.
The list shows all the entered texts.
Use the New function to insert a new one.
In the general tab indicate:
- Code and description: indicative for text recognition
- language and All language codes: indicate the text management language in the Language code field. If the text you are inserting is the default text, you can leave the language code = '' and set the All language codes field.
- Table ID and Type Option table: indicate the starting table and the document type (for provisionals) as in paragraph 2.3 .
- Start Date and End Date: Specify dates to limit the use of the text
- Subject: indicate the subject of the email here, it is possible to use placeholders
- Attachment: in the 4 attachment fields you can insert default attachments that will be sent every time this type of document is sent
In the lines instead it is possible to insert the text of the email.
Placeholders can also be inserted here.
In the Values and Company Information tabs you can insert the fields that will replace the subject and body placeholders. The fields to choose from will be those of the table indicated in the Table ID field for the Values part while in the Company Information tab they are related, in fact, to the company information table:
Senders
There are several ways to set the email sender.
In ascending order of priority:
-
Default Email Account
If no other sender is specified in the other setups, the system will always use the user set as default in the E-Mail Accounts list.
In this case, you can leave the Sender field in the Mail Doc Addresses table blank. -
Setup Mail Text Notification
The sender entered here is always used to send that type of document, it always prevails over the default address set in the E-mail Accounts.
Only encrypted email accounts can be entered in this field. -
Email Doc Addresses.
It is never used at the moment.
Functionality
The action of sending mail is present on the list and tab of all documents.
Both functions will propose the default settings set to setup, senders, recipients and texts, from here the customer will be able to modify the necessary data.
Sending from a document tab allows you to send only the open document.
From the document list, you can send a single document or more than one using multiple selection.
In both cases the sending methods will be the same.
From both the list and the tab, select the Send mail function:
In both cases, a screen will open showing all the default settings found by setup:
Here you can edit any text and all addresses, sender, recipient, CC and BCC.
In the Attachments side factbox you can insert additional attachments for this single submission only.
The attachments inserted here are to be considered additional to the pdf of the selected document (report taken from the relevant report selection ) and to those inserted in the email text used for sending.
To attach documents, click on the calculated field on the right that indicates the number of attachments currently present and then select the file:
Instead, using the Show preview function you can view the subject and text of the email as it would appear inside the email itself and possibly modify it:
To send the email, use the Send function:
If the email sending fails due to system problems, this will be displayed in the Last error field and the line will remain marked as Not sent .
If the problem is related to the email itself, the standard delivery failure email will be delivered to the sender:
If the email sending is successful, the Mail sent flag will be set on the document so that it is possible to understand at a glance whether the document has already been sent or not:
The email will then look like this:
The attached documents will include:
- The printout ord the sent document. In case of specific layouts for the customer (or Vendor) this will be retreived from the standard “Custom report selection” table linked to the masterdata. For all others, the basic report will be attached.
- All additional attachments added before sending.
In the case of multiple submissions, the submission procedure is the same.
The submission page in this case will have not a single record but as many records as the documents selected: