@xuda.io/ai_module 1.1.4497 → 1.1.4499

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.
Files changed (2) hide show
  1. package/index.mjs +4 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -4390,16 +4390,17 @@ const chat_email = async function (req, job_id, headers) {
4390
4390
  }
4391
4391
  const contact_id = sender_conversation_doc.reference_id;
4392
4392
  const contact_info = await account_module.get_contact_info(uid, null, contact_id);
4393
-
4393
+ if (!contact_info.email) {
4394
+ throw new Error('empty contact email');
4395
+ }
4394
4396
  let sent_email_result = {};
4395
4397
 
4396
4398
  // send an email by user invocation
4397
4399
  if (!from_mailbox) {
4398
- const to = '';
4399
4400
  const subject = '';
4400
4401
 
4401
4402
  const email_module = await import(`${module_path}/email_module/index.mjs`);
4402
- const email_ret = email_module.sendEmailFromAccount(email_account_doc, to, subject, body, null, attachments);
4403
+ const email_ret = email_module.sendEmailFromAccount(email_account_doc, contact_info.email, subject, body, null, attachments);
4403
4404
  if (!email_ret.result) {
4404
4405
  throw new Error('error sending email');
4405
4406
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4497",
3
+ "version": "1.1.4499",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",