Skip to content

Codeunit WSB_DigiDocEmailMgt

Provides functionality for e-mailing with Document Mail Queue.

Properties

Name Value
Access Public

Methods

wgFncGetEmailBodyAsText

Produces the email body text for a queue entry.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" vRecWSB_DigiDocQueue The queue entry.
RecordRef vRecRef The recordref of the document.

Returns

Type Description
Text true iff the email body was generated successfully.

wgFncHandleEmailWithPDF

Create and send an e-mail based on the supplied queue entry. Returns true if the send is succesful.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" vRecDigiDocQueue The queue entry

Returns

Type Description
Boolean true iff the email was sent successfully

wlEvpOnAfterAddEmailRelations

Allows to add additional relations to the email message that will be sent via Document Mail Queue.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" vRecDigiDocQueue The queue entry.
Codeunit "Email Message" vCduEmailMessage The email message.

wlEvpOnAfterGetEmailBodyLayoutForReportSelectionUsage

Allows to hook into determining the email body layout from the email body report selection.

Parameters

Type Name Description
Enum "Report Selection Usage" pReportSelectionUsage The report selection usage.
Integer pSourceTableID The table ID of the relation source.
Code[20] pSourceNo The no. of the relation source.
RecordRef vRecRefSourceDoc The recordref for the source document.
Integer vEmailBodyReportID The output Email Body Report ID.
Code[20] vEmailBodyCustomReportLayoutCode The output Email Body Custom Report Layout Code.
Text[250] vEmailBodyLayoutName The output Email Body Layout Name.
Guid vEmailBodyLayoutAppID The output Email Body Layout App ID.
Boolean vFound true iff an email body report selection was found.

wlEvpOnAfterGetEmailScenario

Allows to customize the email scenario that should be used when a queue entry is processed for emailing.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" vRecDigiDocQueueEntry The queue entry.
Enum "Report Selection Usage" pReportUsage The report selection usage.
Enum "Email Scenario" vEmailScenario The output email scenario.

wlEvpOnAfterHandleEmailWithPDF

Allows to hook into handling/producing mail output from a queue entry. This event is triggered right after producing an email for a queue entry.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" vRecDigiDocQueue The queue entry.
Boolean vIsSuccess Indicates if producing the email for the queue entry was successful.

wlEvpOnBeforeAddDefaultAttachment

Allows to hook into adding the document mail queue sending profile default attachment file to an email message. This event is fired right before the default attachment is added to the e-mail message.

Parameters

Type Name Description
`` vCduEmailMessage The email message.
`` vRecDigiDocSendingProfile The Document Mail Queue sending profile.
`` pLanguageCode The Language that is set in the Document Mail Queue entry.
`` vIsHandled Set this parameter to true if this is handled by your custom extension code.
`` vIsSuccess Set this parameter to true if your custom extension code added a default attachment successfully.

wlEvpOnBeforeAddDocumentAttachments

Allows for hooking into attaching the document's attachments to the email message. This event is fired right before Document Mail Queue attempts to add the document's attachments as e-mail attachments.

Parameters

Type Name Description
`` vCduEmailMessage The email message.
`` vRecDigiDocSendingProfile The Document Mail Queue sending profile.
`` pDocumentTableID The table no. of the document
`` pDocumentNo The document no. of the document.
`` vRecRefSourceDoc The recordref for the document.
`` vIsHandled Set this parameter to true if the logic is handled by your custom extension code for this email message, overwriting the default behaviour.
`` vIsSuccess Set this parameter to true if your custom extension code successfully added the document's attachments.

wlEvpOnBeforeAddElectronicDocument

Allows for hooking into attaching the electronic document to the email message. This event is fired right before Document Mail Queue attempts to add the electronic document as e-mail attachments.

Parameters

Type Name Description
`` vCduEmailMessage The email message.
`` vRecDigiDocSendingProfile The Document Mail Queue sending profile.
`` vRecRefSourceDoc The recordref for the document.
`` vIsHandled Set this parameter to true if the logic is handled by your custom extension code for this email message, overwriting the default behaviour.
`` vIsSuccess Set this parameter to true if your custom extension code successfully added the electronic document.

wlEvpOnBeforeAddEmailRelations

Allows to hook into the moment before the additional email relations are added for the email message.

Parameters

Type Name Description
`` vRecDigiDocQueue The queue entry.
`` vCduEmailMessage The email message.

wlEvpOnBeforeGetAttachmentName

Allows for hooking into determining the name for the (PDF) document attachment file. This event is fired right before the default logic for determining the attachment name is triggered.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" pRecDigiDocQueueEntry The queue entry.
Text vAttachmentName The output attachment name.
Boolean vIsSuccess Set this to true if the attachment name was determined successfully by your custom extension code.
Boolean vIsHandled Set this to true if the attachment name generation is handled by your custom extension code, overwriting the default behaviour.

wlEvpOnBeforeGetEmailSubject

Allows to hook into getting the email subject text. This event is triggered right before the email subject is determined.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" pRecDigiDocQueueEntry The queue entry.
Text pDocumentNo The Document No.
Record "WSB_DigiDocSendingProfile" vRecDigiDocSendingProfile The Document Mail Queue Sending Profile
Text vEmailSubject The output email subject
Boolean vIsHandled Set this variable to true if getting the email subject is handled by your custom extension code, overwriting the default behaviour.

wlEvpOnBeforeHandleEmailWithPDF

Allows to hook into handling/producing mail output from a queue entry. This event is triggered right before producing an email for a queue entry.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" vRecDigiDocQueue The queue entry.
Boolean vIsSuccess Set this parameter to true if your extension has handled the queue entry mail generation with custom code successfully.
Boolean vIsHandled Set this parameter to true if the queue entry mail generation was handled by your custom extension code.

wlEvpOnBeforeSetDocumentReportAttachment

Allows to hook into the process of adding a (PDF) document report attachment to the email message.

Parameters

Type Name Description
Record "WSB_DigiDocQueue" pRecDigiDocQueue The queue entry.
Record "WSB_DigiDocSendingProfile" vRecDigiDocSendingProfile The Document Mail Queue sending profile.
Record "Report Selections" temporary vRecTempAttachmentReportSelection The attachment report selection.
Codeunit "Email Message" vCduEmailMessage The email message.
RecordRef vRecRefSourceDoc A recordref of the source document.
Codeunit "Temp Blob" vCduTempBlobPDF A Blob to write a PDF file to.
Boolean vIsHandled Set this parameter to true to overwrite the default behaviour.

wlEvpOnGetEmailBodyLayoutForReportSelectionUsageOnCaseElse

Allows to handle finding the email body report selection for an alternative relation source besides customers and vendors.

Parameters

Type Name Description
Enum "Report Selection Usage" pReportSelectionUsage The report selection usage.
Integer pSourceTableID The table ID of the relation source.
Code[20] pSourceNo The Source No.
RecordRef vRecRefSourceDoc The recordref for the source document.
Record "Report Selections" temporary vRecTempReportSelection The output email body report selection.
Boolean vFound Set this parameter to true if an email body report selection was found for the relation source.