Email - Send Transaction Email
post
/rest/v19/commerce{Stage}{ProcessVarName}{MainDocVarName}/{id}/actions/_send_email
Use this endpoint to collect email form data, generate the attachment, pushe the email to SMTP servers, and return confirmation on email sent time. The email recipient receives an email with the comments in the email body and an attachment that contains the quote information.
Request
Supported Media Types
- application/json
Path Parameters
-
MainDocVarName(required): string
The variable name of the main document, note the first letter must be capitalized.
-
ProcessVarName(required): string
The variable name of the commerce process, note the first letter must be capitalized.
-
Stage(required): string
The stage variable identifies where a transaction is within the Commerce process flow. (Documents, Quotes, Agreements, or Orders)
-
id(required): integer
Current unique user-side ID. This is the internal identifier for a transaction within a CPQ site.
Root Schema : Transaction-_send_emailRequest
Type:
Show Source
object-
actionVariableName:
string
Title:
Action Variable NameThe email action variable name used to look up email action configuration -
attachmentIds:
array Attachments to be merged.
Title:
Attachments to be merged.List of attachments to be merged for an email action. -
attachmentIdsForMerge:
array Attachments to be merged.
Title:
Attachments to be merged.List of attachments to be merged for an email or print action. -
bccEmail:
string
Title:
Bcc EmailThe bcc email address(es) -
cacheInstanceId:
string
Title:
Cache Instance IdThe unique identifier for the entry of transaction data stored in the cache. This typically is obtained from first createTransaction or OpenTransaction action and passed along in subsequent Modify/Interact action to avoid reload transaction data from db. -
ccEmail:
string
Title:
Cc EmailThe cc email address(es) -
comments:
string
Title:
CommentsThe comments to be sent in the email body -
fromName:
string
Title:
From NameThe sender's name -
languageCode:
string
Title:
Preferred LanguageThe language preference for sending email -
subject:
string
Title:
SubjectThe email subject line -
toEmail:
string
Title:
To EmailThe recipient's email address(es) -
toName:
string
Title:
To NameThe recipient's name -
xslView:
integer
Title:
XSL ViewPrinter friendly proposals or history outputs generated from predefined XSL templates
Nested Schema : Attachments to be merged.
Type:
arrayTitle:
Attachments to be merged.List of attachments to be merged for an email action.
Show Source
-
Array of:
object Attachment properties.
Title:
Attachment properties.Captures the id of the attachment.
Nested Schema : Attachments to be merged.
Type:
arrayTitle:
Attachments to be merged.List of attachments to be merged for an email or print action.
Show Source
-
Array of:
object Attachment properties.
Title:
Attachment properties.Captures the id of the attachment.
Nested Schema : Attachment properties.
Type:
objectTitle:
Attachment properties.Captures the id of the attachment.
Show Source
-
id:
integer
ID for the attachment.
Response
Supported Media Types
- application/json
Default Response
Root Schema : Transaction-_send_emailResponse
Type:
Show Source
object-
cacheInstanceId:
string
Title:
Cache Instance IdThe unique identifier for the entry of transaction data stored in the cache. This typically is obtained from first createTransaction or OpenTransaction action and passed along in subsequent Modify/Interact action to avoid reload transaction data from db. -
message:
string
Title:
MessageThe summary message for sending email
Examples
The following example shows how to collect email form data, generates the attachment, pushes the email to SMTP servers, and returns confirmation on email sent time by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.
curl -X POST -H "Authorization: Bearer <token>" -H "Accept: application/json" https://sitename.oracle.com/rest/v19/commerceDocumentsOraclecpqoTransaction/18498612/actions/_send_email
Request Body Sample
{
"actionVariableName": "_action_process_email_print",
"comments": "test comments",
"ccEmail": "",
"toName": "Test To Name",
"subject": "Test subject",
"fromName": "Test From Name",
"toEmail": "test@oracle.com",
"languageCode": "en",
"xslView": "3023146476",
"attachmentIdsForMerge": ["-2", "3023146599", "3023146600"]
}
Response Body Sample
{
"message": "Your email was sent on 06/26/2024 4: 42PM",
"cacheInstanceId": "5J9MTQAbF1ZmcJGnul6y4WOrAydsRpSyR2vvW1o7fWkrEkO89aiFxbEQSIUCEnF4"
}