Document Import via Email
How to enable and configure automatic import of medical fitness certificates via email: import rules, OCR models, editing extracted data, and export.
The document import via email feature enables automatic receipt of medical fitness certificates: the client sends the document to the organization's email address, and the platform extracts the data from the document, identifies the employee by CNP, and allocates the document to their medical record.
Important: Email import is available only on dedicated installations (Enterprise Model) and is an additional feature (add-on), purchased separately. It is not available on the Shared Model (SaaS). It is enabled on request, only on the client's domain. If it has not been enabled for your organization, the options described below will not be visible in the interface. To enable it, contact the SSM team.
About the feature
The flow, in brief:
- The client (typically the occupational medicine clinic) sends the medical fitness certificate, as an attachment, to the organization's email address.
- The platform extracts the text from the document and, based on the configured OCR model, identifies the relevant data (CNP, name, validity dates, medical opinion, recommendations, etc.).
- The employee is identified by CNP.
- The document is automatically allocated to the employee's record, as a new revision of the configured document type.
For the import to work, upon activation the SSM team configures the necessary technical elements on the client's domain (access token for the data-extraction service and email routing to the platform). These elements are not managed from the interface — the SSM administrator only manages the import rules described below.
How it is enabled
The feature is enabled on request, on the client's platform domain.
You can check whether it is active for your organization as follows:
- Go to Settings → Automations.
- If the "Document import via email" option appears in the list, the feature is active.
- If the option does not appear, the feature has not been enabled — contact the SSM team to enable it.
The organization's email address
Each organization has its own email address, in the form:
subdomain@domainThe exact address is displayed on the "Document import via email" page, in the descriptive text at the top:
Send a document to
subdomain@domain, and the application will extract the data from the document, identify the employee, and allocate the document.
Documents are sent, as an attachment, to this address. This is also the address displayed in the Recipient column of the rules table.
Configuring import rules
An import rule determines from which sender documents are accepted and how they are processed.
Access: Settings → Automations → Document import via email.
On this page you see the table with existing rules (columns Sender, Recipient, OCR Model, Active) and the "Add rule" button. For an existing rule, use the ⋮ menu on the right of the row for Edit or Delete.
Adding / editing a rule
Press "Add rule" (or Edit on an existing rule) and fill in:
| Field | Role | Required |
|---|---|---|
| Sender | The email address from which the platform receives the document. Only messages from this sender are processed by the rule. | Yes |
| Identification rule | Additional condition for matching the message: None, Subject contains, or Content contains. | No (default None) |
| Identification text | The text searched for in the subject/content. Appears only if "Identification rule" is different from None. | Only if used |
| Document type | The document type in the platform to which the certificate will be allocated (e.g. medical fitness certificate). | Yes |
| Document OCR model | The data extraction model, depending on the issuing clinic (see below). | Yes |
| Document author | The operator who appears as the author of the automatically created revision. | Yes |
| Attachment password | The file password, if the attachment is password-protected. | Only if applicable |
| Approve previous revision if in progress | If the employee already has a revision in progress (not approved), the new document would be rejected. Checking this option automatically approves only the previous revision, so as not to block the addition of the new version. The newly imported document is not automatically approved — it remains a revision to be reviewed. | No |
| Enable rule | Enables / disables the rule. A disabled rule does not process documents. | — |
Press Save to confirm.
Note: the Sender + OCR Model combination must be unique within the organization — you cannot allocate the same sender to the same OCR model twice.
Routing to multiple OCR models from the same sender
If the same email address receives, from the same sender, multiple types of certificates (with different OCR models), you can route each document to the appropriate model using the "Identification rule" field.
To do this, you create one rule for each OCR model, all with the same Sender, but with a different identification condition:
None— the rule applies to any message from that sender, regardless of content. Use this option only when the sender sends a single type of certificate.Subject contains— the rule applies only if the email's subject contains the text from the "Identification text" field.Content contains— the rule applies only if the email's body contains the text from the "Identification text" field.
This way, when receiving an email, the platform chooses the OCR model based on the word/phrase found in the subject or content. Recommendations:
- Choose a distinctive word or phrase that appears only in the target certificate type (e.g. a code, a document name), to avoid incorrect matches.
- Make sure each certificate type has a different identification text, so that an email matches a single rule.
- If you use a
Nonerule for a sender that sends multiple certificate types, all of them will be processed with the same OCR model — which can lead to incorrect data extraction.
Available OCR models
When configuring the rule, you choose one of the existing OCR models from the "Document OCR model" dropdown list.
The chosen model must match the clinic issuing the certificate — each model is built for the layout of a specific clinic's documents. An incorrect model can lead to incorrect data extraction or failure to identify the employee. If you are not sure which model matches your clinic, contact the SSM team.
What happens when a document is received
When receiving an email that matches an active rule:
- Data extraction — based on the OCR model, data is extracted from the document (CNP, name, issue date, next check-up date, medical opinion, recommendations, certificate number, reason).
- Employee identification — the employee is searched for by CNP. If no valid CNP is identified in the document, or if the CNP does not match any employee, the document is not imported.
- Revision creation:
- If the employee does not yet have the document in question, the document is created with a new revision.
- If the employee already has the document, a new revision is added.
- Rules for the revision in progress — if a revision in progress (not approved) already exists for the document, the import of the new one is refused, except when the rule has the "Approve previous revision if in progress" option checked. In this case, only the previous revision is automatically approved, in order to unblock the addition of the new one; the newly imported revision remains to be reviewed.
In case of an import error (unidentified CNP, non-existent employee, mismatched OCR model, invalid file, etc.), the platform sends an error notification by email (see the troubleshooting section).
Viewing and editing extracted data ("Edit details")
Data automatically extracted from the certificate can be checked and corrected manually.
Access: open the employee's document (medical fitness certificate) and press "Edit details". A side panel opens with the extracted fields.
Editable fields for the medical fitness certificate:
| Field | Type | Description |
|---|---|---|
| Fitness certificate number | text | The number of the medical fitness certificate. |
| Medical opinion | list | Fit / Fit with conditions / Temporarily unfit / Unfit. |
| Certificate for / Reason | text | The reason for the examination (e.g. Hiring, Periodic medical check-up). |
| Additional fitness requirements / Recommendations | text | The recommendations / observations from the certificate (e.g. "with optical correction"). |
After making changes, save the panel to update the revision data.
Note on validity dates: the certificate's validity dates (issue date and next check-up date) are the start and end dates of the revision and are edited directly on the revision, not from this panel.
Data export ("By document type" report)
Imported data (including fields extracted from certificates) can be exported into a report by document type.
Steps:
- Go to the Reports section.
- Press "By document type".
- Choose the desired document type (e.g. medical fitness certificate) from the list.
- Press Generate.
- Once generation is complete, press Download to obtain the XLSX file.
The exported file includes, in columns, the fields extracted from the certificate (Fitness certificate number, Medical opinion, Certificate for / Reason, Additional fitness requirements / Recommendations), alongside the document data.
Troubleshooting and notes
If a document sent by email does not appear for the employee, check:
- OCR model mismatched for the clinic — the model in the rule must match the clinic that issued the certificate.
- Unidentified CNP — if the document does not contain a readable/valid CNP, the import fails.
- Non-existent employee — the extracted CNP does not match any employee in the platform.
- Revision in progress — a draft for the document already exists, and the rule does not have "Approve previous revision if in progress" checked.
- Inactive rule or wrong sender — check that an active rule exists for exactly the address from which the document was sent.
- Password-protected attachment — if the file has a password, it must be filled in on the rule.
When an import fails, the platform sends an error notification by email to the rule's author (or, in their absence, to the organization's contact address), with details about the message that generated the error.
Recommendation: imported documents are added as a new revision, to be reviewed (they are not automatically approved). When enabling the feature for a new clinic, check the data extracted on several real certificates before relying on the import. The "Approve previous revision if in progress" option affects only the previous revision, not the newly imported document.