Send Account Email
Function: account_send_email()
Purpose
This function sends an email communication linked to a specific account. It supports multiple recipients, CC/BCC, file attachments, and template-based or custom email content, and stores the communication history against the account.
Parameters
| Parameter | Type | Description |
|---|---|---|
| account_id | String | Unique identifier of the account. |
Use Case
The function is used to send email communications directly from an account context. It helps users contact customers or stakeholders, share documents, track outbound correspondence, and maintain a complete communication history linked to the account. This is commonly used for follow-ups, document sharing, notifications, and customer engagement workflows.
def test_account_send_email():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = True
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
account_id = "Account_Id"
file_url = "Specific file path"
email_data = {
"to": "testautobill@yopmail.com",
"cc": ["demo.one@yopmail.com", "demo.two@yopmail.com"],
"bcc": ["demo.three@yopmail.com", "demo.four@yopmail.com"],
"subject": "Sent from WebAlive",
"body": "This is a test note (account) 1234xxx."
}
response = exsited_sdk.account.account_sent_email(
file_url=file_url,
email_data=email_data,
account_id=account_id
)
print(response)
except ABException as ab:
print("Error:", ab)
print("Details:", ab.get_errors())
print("Raw Response:", ab.raw_response)
public function testSendAccountEmail()
{
$accountId = 'Account_Id';
$filePath = 'Specific file path';
$params = [
'to' => 'chandler99@yopmail.com',
'cc' => 'bing@yopmail.com,bing2@yopmail.com',
'bcc' => 'bing34@yopmail.com,bing35@yopmail.com',
'subject' => 'subject added fgd',
'body' => 'bodddyyyyyyy finaal 2dgdg'
];
if (file_exists($filePath)) {
$params['attachment'] = new \CURLFile($filePath, mime_content_type($filePath), basename($filePath));
}
try {
$response = $this->communicationService->sendAccountEmail($accountId, $params, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns an object containing the newly created email communication record for the account. The response includes email metadata such as UUID, message type, status, sender and recipient addresses, CC/BCC lists, subject, body content, attachment details (name, path, size, and type), and creation and update timestamps. This ensures traceability and auditing of all account-level email communications.
{
"account": {
"communication": {
"email": {
"uuid": "17eb7458-0f1f-46c6-80df-795eb7e53be8",
"message_type": "SENT",
"status": "ACTIVE",
"from": "abc@webalive.com.au",
"to": "testautobill@yopmail.com",
"cc": [
"demo.one@yopmail.com",
"demo.two@yopmail.com"
],
"bcc": [
"demo.three@yopmail.com",
"demo.four@yopmail.com"
],
"subject": "Sent from WebAlive",
"body": "This is a test note (account) 1234xxx.",
"additional_template": "",
"created_at": "2025-02-17 11:43:52",
"last_updated_at": "2025-02-17 11:43:52",
"attachments": [
{
"name": "New Microsoft Word Document.docx",
"path": "folder-17eb7458/2AWD2CIZW15H20X806.docx",
"size": 11815,
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
}
}
}
}
{
"account": {
"communication": {
"email": {
"uuid": "17eb7458-0f1f-46c6-80df-795eb7e53be8",
"message_type": "SENT",
"status": "ACTIVE",
"from": "abc@webalive.com.au",
"to": "chandler99@yopmail.com",
"cc": [
"bing@yopmail.com",
"bing2@yopmail.com"
],
"bcc": [
"bing34@yopmail.com",
"bing35@yopmail.com"
],
"subject": "subject added fgd",
"body": "",
"additional_template": "",
"created_at": "2025-02-17 11:43:52",
"last_updated_at": "2025-02-17 11:43:52",
"attachments": [
{
"name": "test-document.docx",
"path": "folder-17eb7458/2AWD2CIZW15H20X806.docx",
"size": 11815,
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
}
}
}
}
Get Account Email Communications
Function: account_get_email()
Purpose
This function retrieves a paginated list of email communications associated with a specific account. It provides visibility into all sent email interactions, including recipients, subject, attachments, and timestamps, allowing users to track and audit account-level communications.
Parameters
| Parameter | Type | Description |
|---|---|---|
| order_by | String | Field name to sort the result set. |
| direction | String | Sorting direction. Accepts asc or desc. |
| limit | Integer | Number of records to retrieve per page. |
| offset | Integer | Number of records to skip from the beginning |
Use Case
The function is used to fetch the email communication history for an account. It helps users review previously sent emails, verify recipients and attachments, monitor communication activity, and maintain a complete audit trail of customer or stakeholder correspondence in a summarized, paginated format.
def test_account_get_email():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.account.account_get_email(id="Acount_ID")
print(response)
# ResponseToObj().process(response=response["accounts"][0])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadAccountEmails()
{
$accountId = 'Account_ID';
try {
$response = $this->communicationService->readAccountEmails($accountId, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns an object containing a list of email communication entries linked to the account. Each entry includes full email metadata such as UUID, message type, status, sender and recipient addresses (To, CC, BCC), subject, body content, attachments with file details, and creation and update timestamps. The response also includes pagination information such as total record count, limit, offset, and navigation references for previous and next pages.
{
"account": {
"communication": {
"emails": [
{
"uuid": "ddb9f7aa-6f45-49c4-8953-b086529a115b",
"message_type": "SENT",
"status": "ACTIVE",
"from": "kawsar@webalive.com.au",
"to": "chandler99@yopmail.com",
"cc": [
"bing@yopmail.com",
"bing2@yopmail.com"
],
"bcc": [
"bing34@yopmail.com",
"bing35@yopmail.com"
],
"subject": "subject added fgd",
"body": "",
"additional_template": "",
"created_at": "2025-02-16 03:13:18",
"last_updated_at": "2025-02-16 03:13:18",
"attachments": [
{
"name": "New Microsoft Word Document.docx",
"path": "folder-ddb9f7aa/VWZZZXV7ZTCISRT3782.docx",
"size": 11815,
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
},
{
"uuid": "17eb7458-0f1f-46c6-80df-795eb7e53be8",
"message_type": "SENT",
"status": "ACTIVE",
"from": "kawsar@webalive.com.au",
"to": "chandler99@yopmail.com",
"cc": [
"bing@yopmail.com",
"bing2@yopmail.com"
],
"bcc": [
"bing34@yopmail.com",
"bing35@yopmail.com"
],
"subject": "subject added fgd",
"body": "",
"additional_template": "",
"created_at": "2025-02-17 11:43:52",
"last_updated_at": "2025-02-17 11:43:52",
"attachments": [
{
"name": "New Microsoft Word Document.docx",
"path": "folder-17eb7458/2AWD2CIZW15H20X806.docx",
"size": 11815,
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
}
],
"pagination": {
"records": 2,
"limit": 100,
"offset": 0,
"previous_page": "",
"next_page": "NULL"
}
}
}
}
{
"account": {
"communication": {
"emails": [
{
"uuid": "ddb9f7aa-6f45-49c4-8953-b086529a115b",
"message_type": "SENT",
"status": "ACTIVE",
"from": "kawsar@webalive.com.au",
"to": "chandler99@yopmail.com",
"cc": [
"bing@yopmail.com",
"bing2@yopmail.com"
],
"bcc": [
"bing34@yopmail.com",
"bing35@yopmail.com"
],
"subject": "subject added fgd",
"body": "",
"additional_template": "",
"created_at": "2025-02-16 03:13:18",
"last_updated_at": "2025-02-16 03:13:18",
"attachments": [
{
"name": "New Microsoft Word Document.docx",
"path": "folder-ddb9f7aa/VWZZZXV7ZTCISRT3782.docx",
"size": 11815,
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
},
{
"uuid": "17eb7458-0f1f-46c6-80df-795eb7e53be8",
"message_type": "SENT",
"status": "ACTIVE",
"from": "kawsar@webalive.com.au",
"to": "chandler99@yopmail.com",
"cc": [
"bing@yopmail.com",
"bing2@yopmail.com"
],
"bcc": [
"bing34@yopmail.com",
"bing35@yopmail.com"
],
"subject": "subject added fgd",
"body": "",
"additional_template": "",
"created_at": "2025-02-17 11:43:52",
"last_updated_at": "2025-02-17 11:43:52",
"attachments": [
{
"name": "New Microsoft Word Document.docx",
"path": "folder-17eb7458/2AWD2CIZW15H20X806.docx",
"size": 11815,
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
}
],
"pagination": {
"records": 2,
"limit": 100,
"offset": 0,
"previous_page": "",
"next_page": "NULL"
}
}
}
}
Get Account Email Communication
Function: account_get_email_uuid()
Purpose
This function retrieves the detailed information of a specific email communication associated with an account using the email UUID. It allows users to view the full content and metadata of a single sent email, including recipients, attachments, and timestamps.
Parameters
| Parameter | Type | Description |
|---|---|---|
| account_id | String | Unique identifier of the account |
| email_uuid | String | Unique identifier of the email communication |
Use Case
This function is used when a user needs to view or audit a specific email sent from an account. It is useful for verifying delivery details, reviewing recipients (To, CC, BCC), checking attached files, and confirming the exact content and timing of an individual communication.
def test_account_get_email_uuid():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.account.account_get_email_uuid(id="Account_Id", uuid='Email_Uuid')
print(response)
# ResponseToObj().process(response=response["accounts"][0])
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadAccountEmailDetails()
{
$accountId = 'Account_Id';
$emailId = 'Account_Id';
try {
$response = $this->communicationService->readAccountEmailDetails($accountId, $emailId, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns an object containing a single email communication record linked to the specified account. The response includes the email UUID, message type, status, sender and recipient information, subject, body, optional template data, attachment details (file name, path, size, and MIME type), and timestamps indicating when the email was created and last updated.
{
"account": {
"communication": {
"email": {
"uuid": "d79744ae-e5bf-44f5-9275-d15acf779501",
"message_type": "SENT",
"status": "ACTIVE",
"from": "kawsar@webalive.com.au",
"to": "chandler99@yopmail.com",
"cc": [
"bing@yopmail.com",
"bing2@yopmail.com"
],
"bcc": [
"bing34@yopmail.com",
"bing35@yopmail.com"
],
"subject": "subject added fgd",
"body": "",
"additional_template": "",
"created_at": "2025-02-16 03:03:29",
"last_updated_at": "2025-02-16 03:03:29",
"attachments": [
{
"name": "New Microsoft Word Document.docx",
"path": "folder-d79744ae/2599BVX9S61EUJ77866.docx",
"size": 11815,
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
}
}
}
}
{
"account": {
"communication": {
"email": {
"uuid": "d79744ae-e5bf-44f5-9275-d15acf779501",
"message_type": "SENT",
"status": "ACTIVE",
"from": "kawsar@webalive.com.au",
"to": "chandler99@yopmail.com",
"cc": [
"bing@yopmail.com",
"bing2@yopmail.com"
],
"bcc": [
"bing34@yopmail.com",
"bing35@yopmail.com"
],
"subject": "subject added fgd",
"body": "",
"additional_template": "",
"created_at": "2025-02-16 03:03:29",
"last_updated_at": "2025-02-16 03:03:29",
"attachments": [
{
"name": "New Microsoft Word Document.docx",
"path": "folder-d79744ae/2599BVX9S61EUJ77866.docx",
"size": 11815,
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
}
}
}
}
