@xuda.io/ai_module 1.1.4489 → 1.1.4491
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 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4383,6 +4383,8 @@ 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
|
+
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
4387
|
+
|
|
4386
4388
|
// send an email by user invocation
|
|
4387
4389
|
if (!from_mailbox) {
|
|
4388
4390
|
const to = '';
|
|
@@ -4391,9 +4393,11 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
4391
4393
|
|
|
4392
4394
|
const email_module = await import(`${module_path}/email_module/index.mjs`);
|
|
4393
4395
|
const email_ret = email_module.sendEmailFromAccount(email_account_doc, to, subject, text, null, attachments);
|
|
4396
|
+
if (!email_ret.result) {
|
|
4397
|
+
throw new Error('error sending email');
|
|
4398
|
+
}
|
|
4394
4399
|
}
|
|
4395
4400
|
|
|
4396
|
-
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
4397
4401
|
if (perform_ai_execution) {
|
|
4398
4402
|
await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
|
|
4399
4403
|
}
|