|
13 | 13 |
|
14 | 14 | from seaserv import seafile_api |
15 | 15 |
|
16 | | -from dtable_events.app.config import DTABLE_WEB_SERVICE_URL, INNER_DTABLE_SERVER_URL |
| 16 | +from dtable_events.app.config import DTABLE_WEB_SERVICE_URL, INNER_DTABLE_SERVER_URL, INNER_DTABLE_DB_URL |
17 | 17 | from dtable_events.dtable_io.big_data import import_excel_to_db, update_excel_to_db, export_big_data_to_excel, \ |
18 | 18 | export_app_table_page_to_excel |
19 | 19 | from dtable_events.dtable_io.utils import import_archive_from_src_dtable, post_big_data_screen_app_zip_file, \ |
|
36 | 36 | from dtable_events.statistics.db import save_email_sending_records, batch_save_email_sending_records |
37 | 37 | from dtable_events.data_sync.data_sync_utils import run_sync_emails |
38 | 38 | from dtable_events.utils import is_valid_email, uuid_str_to_36_chars, gen_file_upload_url, uuid_str_to_32_chars |
| 39 | +from dtable_events.utils.dtable_db_api import DTableDBAPI |
39 | 40 | from dtable_events.utils.dtable_server_api import DTableServerAPI, BaseExceedsException |
40 | 41 | from dtable_events.utils.dtable_web_api import DTableWebAPI |
41 | 42 | from dtable_events.utils.exception import ExcelFormatError |
@@ -861,7 +862,12 @@ def send_notification_msg(emails, user_col_key, msg, dtable_uuid, username, tabl |
861 | 862 | if not table: |
862 | 863 | return |
863 | 864 |
|
864 | | - target_row = dtable_server_api.get_row(table['name'], row_id) |
| 865 | + sql = f"SELECT * FROM `{table['name']}` WHERE _id='{row_id}'" |
| 866 | + dtable_db_api = DTableDBAPI(username, dtable_uuid, INNER_DTABLE_DB_URL) |
| 867 | + rows = dtable_db_api.query(sql, convert=True, server_only=True)[0] |
| 868 | + if not rows: |
| 869 | + return |
| 870 | + target_row = rows[0] |
865 | 871 |
|
866 | 872 | sending_list = emails |
867 | 873 | if user_col_key: |
@@ -1173,7 +1179,12 @@ def plugin_email_send_email(context): |
1173 | 1179 | dtable_server_api = DTableServerAPI(username, dtable_uuid, INNER_DTABLE_SERVER_URL, dtable_web_service_url=DTABLE_WEB_SERVICE_URL, |
1174 | 1180 | repo_id=repo_id, workspace_id=workspace_id) |
1175 | 1181 |
|
1176 | | - replied_email_row = dtable_server_api.get_row(email_table_name, email_row_id) |
| 1182 | + sql = f"SELECT * FROM `{email_table_name}` WHERE _id='{email_row_id}'" |
| 1183 | + dtable_db_api = DTableDBAPI(username, dtable_uuid, INNER_DTABLE_DB_URL) |
| 1184 | + rows = dtable_db_api.query(sql, convert=True, server_only=True)[0] |
| 1185 | + if not rows: |
| 1186 | + return |
| 1187 | + replied_email_row = rows[0] |
1177 | 1188 |
|
1178 | 1189 | thread_id = replied_email_row.get('Thread ID') |
1179 | 1190 |
|
|
0 commit comments