Skip to content

Commit 1499178

Browse files
updated document id
1 parent 90e1c00 commit 1499178

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

src/sap_cloud_sdk/outputmanagement/clients/email_client.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,12 @@ def create_output_request(
5454
Returns:
5555
OutputRequest: Fully constructed output request ready to send
5656
"""
57-
# Extract document type and ID from business document
57+
# Extract document type from business document
5858
# Assuming the first key in business_document is the document type
5959
doc_type_key = next(iter(business_document.keys()))
60-
doc_content = business_document[doc_type_key]
6160

62-
# Try to extract document ID from common field names
63-
doc_id = None
64-
for id_field in ['id', 'orderId', 'invoiceNumber', 'documentId', 'number']:
65-
if id_field in doc_content:
66-
doc_id = str(doc_content[id_field])
67-
break
68-
69-
# If no ID found, use template key as fallback
70-
if not doc_id:
71-
doc_id = f"{notification_template_key}-{id(business_document)}"
72-
73-
# Generate business document type from the key
61+
# Generate business document ID and type
62+
doc_id = doc_type_key
7463
business_document_type = f"com.sap.{doc_type_key.lower()}"
7564

7665
# Build attachment config if URLs are provided

0 commit comments

Comments
 (0)