Codeunit "Email Scenario"
Provides functionality to work with email scenarios.
Methods
GetDefaultEmailAccount
Gets the default email account.
procedure GetDefaultEmailAccount(var EmailAccount: Record "Email Account" temporary): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| EmailAccount | Table System.Email."Email Account" |
Out parameter holding information about the default email account. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if an account for the the default scenario was found; otherwise - false. |
GetEmailAccount
Gets the email account used by the given email scenario. If the no account is defined for the provided scenario, the default account (if defined) will be returned.
procedure GetEmailAccount(Scenario: Enum "Email Scenario", var EmailAccount: Record "Email Account" temporary): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.Email."Email Scenario" |
The scenario to look for. |
| EmailAccount | Table System.Email."Email Account" |
Out parameter holding information about the email account. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if an account for the specified scenario was found; otherwise - false. |
IsThereEmailAccountSetForScenario
Check if there is an email account set for the given email scenario.
procedure IsThereEmailAccountSetForScenario(Scenario: Enum "Email Scenario"): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.Email."Email Scenario" |
The scenario to look for. |
Returns
| Type | Description |
|---|---|
| Boolean |
True if there is an account set for the specified scenario; otherwise - false. |
SetDefaultEmailAccount
Sets a default email account.
procedure SetDefaultEmailAccount(EmailAccount: Record "Email Account" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| EmailAccount | Table System.Email."Email Account" |
The email account to use. |
SetEmailAccount
Sets an email account to be used by the given email scenario.
procedure SetEmailAccount(Scenario: Enum "Email Scenario", EmailAccount: Record "Email Account" temporary)
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.Email."Email Scenario" |
The scenario for which to set an email account. |
| EmailAccount | Table System.Email."Email Account" |
The email account to use. |
UnassignScenario
Unassign an email scenario. The scenario will then use the default email account.
procedure UnassignScenario(Scenario: Enum "Email Scenario")
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.Email."Email Scenario" |
The scenario to unassign. |
Events
OnBeforeInsertAvailableEmailScenario
Event for changing whether an email scenario should be added to the list of assignable scenarios. If the scenario has already been assigned or is the default scenario, this event won't be published.
[IntegrationEvent(False,False,True)]
internal procedure OnBeforeInsertAvailableEmailScenario(Scenario: Enum "Email Scenario", var IsAvailable: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| Scenario | Enum System.Email."Email Scenario" |
The scenario that is going to be added to the list of assignable scenarios. |
| IsAvailable | Boolean |
The return for whether this scenario should be listed in the assignable scenarios list. |