@xuda.io/ai_module 1.1.4486 → 1.1.4488
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +11 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4370,7 +4370,7 @@ const chat_note = async function (req, job_id, headers) {
|
|
|
4370
4370
|
};
|
|
4371
4371
|
|
|
4372
4372
|
const chat_email = async function (req, job_id, headers) {
|
|
4373
|
-
const { uid, email_id, perform_ai_execution = true } = req;
|
|
4373
|
+
const { uid, email_id, perform_ai_execution = true, from_mailbox } = req;
|
|
4374
4374
|
const account_profile_info = await account_module.get_active_account_profile_info(uid);
|
|
4375
4375
|
let { prompt: body, conversation_doc, attachments = [], ai_agents } = req;
|
|
4376
4376
|
try {
|
|
@@ -4383,6 +4383,16 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4383
4383
|
|
|
4384
4384
|
let email_account_doc = await db_module.get_app_couch_doc_native(sender_app_id, account_profile_info.account_profile_obj?.email_account_id);
|
|
4385
4385
|
|
|
4386
|
+
// send an email by user invocation
|
|
4387
|
+
if (!from_mailbox) {
|
|
4388
|
+
const to = '';
|
|
4389
|
+
const subject = '';
|
|
4390
|
+
const text = '';
|
|
4391
|
+
|
|
4392
|
+
const email_module = await import(`${module_path}/email_module/index.mjs`);
|
|
4393
|
+
const email_ret = email_module.sendEmailFromAccount(email_account_doc, '');
|
|
4394
|
+
}
|
|
4395
|
+
|
|
4386
4396
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
4387
4397
|
if (perform_ai_execution) {
|
|
4388
4398
|
await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
|