Automated link of attachments
Preamble
This service automatically processes incoming emails and attaches the received files (PDF, image formats) to internal system entities such as AWB (Air Waybill), Flights, Jobs, Enquiries, or Customer Requests. The system determines where to link the files based on special markers found in the email body or attachments.
What You Need to Know Before Sending Emails
To link your attached files correctly, the system requires structured information (called markers) in the body of the email or inside the attached files. These markers let the system identify which entity each file should be attached to.
Each marker follows a specific format, which is described below.
Supported Entity Types and Marker Formats
Markers must be written inside square brackets, and start with a letter indicating the entity type. Multiple markers can be used in one email.
A - AWB (Air Waybill): A:[AWB number]
Example: A:[123-45678901]
F - Flight: F:[FlightNumber/Date/Optional]
Example: F:[PS123/2024-12-01]
Optionally, you may add: F:[PS123/2024-12-01/DOH]
J - Job: J:[Job ID]
Example: J:[JB-87234]
E - Enquiry: E:[Enquiry ID]
Example: E:[ENQ-000123]
C - Customer Request: C:[Request number]
Example: C:[REQ-4321]
You can include more than one marker. The system will try to attach the file to every valid entity it finds.
Details About Each Entity Type
AWB (Air Waybill):
Must follow the correct format: a 3-digit prefix and an 8-digit number (e.g., 123-45678901).
If the AWB does not exist, the system will automatically create a new record and link the files to it.
Flight:
The format is F:[FlightNumber/Date/OptionalText]
The system searches for a flight by matching the provided flight number and date.
Date format must be YYYY-MM-DD.
The third optional field can be a time, airport code, or any keyword, but it is not required.
The date in the flight marker is interpreted using time zone rules:
You can add L or U at the end (e.g. F:[PS123/2024-12-01]L or F:[PS123/2024-12-01]U)
L means Local time, U means UTC
If L or U are not specified, the system uses the global setting "ScanAttachmentTimeFormat":
If it is set to 1, UTC is used
If not set, Local time is assumed
The system only links to active (non-deleted) flights. Deleted flights are ignored.
Enquiry (E):
Only existing enquiries can be used. If the Enquiry ID is invalid or missing, the files will not be linked.
Job (J):
Only existing jobs can be used. If the Job ID is not found, or the job is marked as deleted, the file will be ignored.
Customer Request (C):
Used to attach files to specific internal request records. The number must be correct and already exist in the system.
How Attachments Are Processed
Supported formats: PDF, JPG, PNG
If a file is an image or scanned document, the system uses OCR (Optical Character Recognition) to extract text and detect markers
Markers can appear either in the email body or within the attached files
A maximum of 12 PDF files per email is supported
If no valid marker is found in either the email or attachments, the files will not be attached to any entity.
What Happens After the Email Is Processed
If the system successfully links at least one file to an entity:
You will receive an automatic confirmation email saying that the file(s) were attached
If an error occurs (e.g., incorrect marker format, invalid ID, missing entity):
You will receive a reply email with an error message describing what went wrong
Each incoming email generates a result — either a success or a failure notification.
To receive the results of the processing of the messages, your mail should be added to the global “email_awb_parser”. If there is no such global in global settings, you should add it. After that add your mail in the value field of this global.
Key: email_awb_parser
Value: list of emails comma separated
After adding your mail, you will receive emails with the results of attaching your files to the system.
Letter’s subject: Images Scan AWB processing result from Awery
The letter contains the text you sent.
The results are displayed below it:
Success - in case of successful file attachment. Success results will not be sent every time, only if you indicate 'test' in the subject of the body of the letter.
Not found - in the specified item is not found in the database
Exists - if such a file is already attached.
Summary of Rules and Limitations
Markers must be properly formatted with brackets and colons (e.g., A:[...], F:[...])
Only valid, existing entities will be linked (except AWBs — those can be created)
Files can be linked to multiple entities if multiple markers are found
Only active flights and jobs are supported
If no marker is found or matched, the file will be ignored
Confirmation or error email is always sent to the sender