@xuda.io/ai_module 1.1.4493 → 1.1.4494
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 +5 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4385,18 +4385,19 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4385
4385
|
|
|
4386
4386
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
4387
4387
|
|
|
4388
|
+
let sent_email_result = {};
|
|
4389
|
+
|
|
4388
4390
|
// send an email by user invocation
|
|
4389
4391
|
if (!from_mailbox) {
|
|
4390
4392
|
const to = '';
|
|
4391
4393
|
const subject = '';
|
|
4392
|
-
const text = '';
|
|
4393
4394
|
|
|
4394
4395
|
const email_module = await import(`${module_path}/email_module/index.mjs`);
|
|
4395
|
-
const email_ret = email_module.sendEmailFromAccount(email_account_doc, to, subject,
|
|
4396
|
+
const email_ret = email_module.sendEmailFromAccount(email_account_doc, to, subject, body, null, attachments);
|
|
4396
4397
|
if (!email_ret.result) {
|
|
4397
4398
|
throw new Error('error sending email');
|
|
4398
4399
|
}
|
|
4399
|
-
|
|
4400
|
+
sent_email_result = email_ret.result;
|
|
4400
4401
|
}
|
|
4401
4402
|
|
|
4402
4403
|
if (perform_ai_execution) {
|
|
@@ -4417,7 +4418,7 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4417
4418
|
sender_conversation_doc.messages.push(obj);
|
|
4418
4419
|
await db_module.save_app_couch_doc_native(sender_app_id, sender_conversation_doc);
|
|
4419
4420
|
|
|
4420
|
-
const save_ret = await db_module.save_app_couch_doc_native(sender_app_id, { _id: obj.id, stat: 3, docType: 'chat_conversation_item', ts: obj.ts, uid, conversation_type: obj.conversation_type, date_created_ts: obj.ts, conversation_id, body, email_id });
|
|
4421
|
+
const save_ret = await db_module.save_app_couch_doc_native(sender_app_id, { _id: obj.id, stat: 3, docType: 'chat_conversation_item', ts: obj.ts, uid, conversation_type: obj.conversation_type, date_created_ts: obj.ts, conversation_id, body, email_id, sent_email_result });
|
|
4421
4422
|
|
|
4422
4423
|
return save_ret;
|
|
4423
4424
|
} catch (err) {
|