Retail:Send By Email
Contents |
Introduction
The aim of this development is to be able to send any printable document also by email.
As of now, only orders and invoices are able to be sent by email, but the infrastructure will allow in the future to send additional documents by email.
As of now, orders and invoices could be selected to be sent by email in two different flows:
- An order is completed
- A ticket is printed using “Print” option from menu
Installation
This functionality uses a common API created in mobile.core module to handle document deliver
- POS:
To be able to use send email functionality in POS an additional module should be installed:
https://gitlab.com/openbravo/devel/pmods/org.openbravo.retail.sendemail/
Configuration
Touchpoint type
In Channel Touchpoint Type window, we should mark "Send documents by mail"
Business Partner
In Business Partner window, we could mark to receive Invoices via email and select also the default language used in the email
Email Server
Also, to test the development it is required to configure email server configuration. It should be done at client level.
http://wiki.openbravo.com/wiki/Client#Email_Configuration
We recommend using a personal gmail account as a destination and your current openbravo account as sender. This feature should be enabled in your openbravo account in order to work
External Business Partner
![]() | Note: Since 0.1.0 version the module is compatible with External Business Partner introduced in 20Q3 |
The module adds a new flag, called Email Address, to define which property represents the customer’s email.
This field (and the one available at terminal level) will activate the functionality when working with External Business Partner integrations. Obviously the email will be sent to the address informed in this property.
If you want to customize the email with any information related to the concrete customer, like the first name or last name, you must implement the necessary hooks available in the module:
- OBSMAIL_PreManageEmailAttachmentsHook (to generate the files to be attached)
- OBSMAIL_PostCreateEmailSubjectHook (to generate the email’s subject)
- OBSMAIL_PostCreateEmailBodyHook (to generate the email’s body)
Preferences
- Enable Send Email for every customer: When properly configured, enables the option to send always documents by email
POS Components
Deliver Document Component
In this popup, five different scenarios could happen:
- Popup is cancelled: Nothing happens and the process is cancelled
- Popup is continued but no option is selected: The process continues but the receipt is neither printed nor sent by email
- Popup is continued and only "Send Email" option is selected: The process continues and the receipt (and/or invoice) is sent by email
- Popup is continued and only "Print" option is selected: The process continues and the receipt (and/or invoice) is printed
- Popup is continued and both options are selected: The process continues and the receipt (and/or invoice) is printed and sent by email
Resend Document By Email Component
In this poup, two scenarios could happen:
- Popup is cancelled: Nothing happens and the process is cancelled
- Send Email option is clicked: The process continues and the receipt (and/or selected invoices) is sent by email
Functional flows
As mentioned previously, the only document implemented right now to be sent by email are orders and invoices.
Order Completion
The popup will be shown when completing this kind of orders:
- Tickets
- Credit Tickets
- Cancelled tickets
- Replaced Tickets
- Completed Quotations
- Multi Tickets
- Multi Credit Tickets
Printing on demand
Loaded ticket can be printed and sent by email using "Print" option from menu. In the opened popup, it is possible to send by email not only the receipt but also the selected invoices (all to the same email address)