Mail processing method and device, computer equipment and storage medium
By providing an automated email processing method in the financial industry, it solves the low efficiency and accuracy problems of email sending caused by traditional manual operations, and achieves efficient and accurate email sending processing.
Patent Information
- Application Number
- CN202411369858.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-21
AI Technical Summary
When performing email sending tasks, the financial industry has problems of inefficient processing and low accuracy, especially when facing the demand for large-scale email sending.
Provide an email processing method that determines the email sending request triggered by the user, displays the email management interface to receive email configuration information and target email templates, performs information verification, creates email sending tasks, obtains HTML template files, variable filling processing, and performs email processing. Allows sending verification and performs mail sending processing.
It realizes the automatic and accurate completion of email generation and sending processing, improves the processing efficiency and accuracy of email sending, and solves the low efficiency and accuracy problems caused by traditional manual operations.
Smart Images

Figure CN119342030A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of data processing technology and financial technology, and in particular to mail processing methods, devices, computer equipment and storage media. Background Art
[0002] In the current financial industry, email communication is an important channel for enterprises to communicate with customers, partners and internal employees, and its efficiency, accuracy and security are crucial. However, many financial companies still generally use a more traditional and highly manual method to perform email sending tasks. This method shows significant efficiency bottlenecks and potential risks when facing large-scale email sending needs.
[0003] First, from the perspective of efficiency, the traditional manual email sending method requires employees to manually write email content, select recipients, set email parameters, etc. This process is not only time-consuming and laborious, but also with the increase in the number of emails, the workload rises sharply, resulting in low overall work efficiency. Especially in the financial field, it is often necessary to send emails such as account notifications, transaction confirmations, market reports, etc. to a large number of customers. Manual operations obviously cannot meet the needs of efficiency and speed.
[0004] Secondly, in terms of accuracy, manual email delivery is prone to errors due to human factors. For example, incorrect input of the recipient's address, omission or error in the email content, incorrect attachment addition, etc. These problems will not only affect the delivery rate and reading rate of the email, but may also cause negative consequences such as customer dissatisfaction and loss of trust. Summary of the invention
[0005] The purpose of the embodiments of the present application is to propose an email processing method, device, computer equipment and storage medium to solve the technical problems of low processing efficiency and low accuracy in the existing email sending method used in the financial industry.
[0006] In order to solve the above technical problems, the present application provides an email processing method, which adopts the following technical solution:
[0007] Determine whether to receive the email sending request triggered by the user;
[0008] If yes, display a preset email management interface, and receive the email configuration information entered by the user in the email management interface and the selected target email template;
[0009] Performing information verification on the email configuration information;
[0010] If the email configuration information passes the information verification, creating a corresponding target email sending task based on the email configuration information;
[0011] When the sending time point corresponding to the target email sending task is reached, the HTML template file corresponding to the target email sending task is obtained from a preset file server;
[0012] Perform variable filling processing on the HTML template file based on the email configuration information to obtain corresponding target email content;
[0013] Based on the preset mail sending management rules, verify the content of the target mail to see if it is allowed to be sent;
[0014] If the target email content passes the email sending permission verification, the email sending process corresponding to the target email content is executed.
[0015] Furthermore, the step of verifying the email configuration information specifically includes:
[0016] Analyze the email configuration information to determine whether all required items are included in the email configuration information;
[0017] If all the required items are included in the email configuration information, determining whether the data format of the email configuration information is in a correct format;
[0018] If yes, obtaining recipient information from the email configuration information;
[0019] Determine whether the recipient information exists in a preset blacklist;
[0020] If the recipient information does not exist in the blacklist, it is determined that the email configuration information passes the information verification; otherwise, it is determined that the email configuration information fails the information verification.
[0021] Furthermore, the step of performing variable filling processing on the HTML template file based on the email configuration information to obtain the corresponding target email content specifically includes:
[0022] Parsing the HTML template file to obtain corresponding variable placeholders;
[0023] Extracting a data value corresponding to the variable placeholder from the email configuration information;
[0024] Call the preset template engine;
[0025] Based on the template engine, the variable placeholders in the HTML template file are replaced with corresponding data values to obtain a processed HTML template file;
[0026] The processed HTML template file is used as the target email content.
[0027] Furthermore, the step of performing verification processing on the target email content to determine whether the email is allowed to be sent based on the preset email sending management rules specifically includes:
[0028] Loading the email sending management rules corresponding to the email sending task; wherein the email sending management rules at least include environment switch rules, template switch rules and flow control rules;
[0029] Detecting whether the current environment allows sending emails based on the environment switch rule;
[0030] If the current environment allows sending emails, detecting whether the target email template is in a disabled state based on the template switch rule;
[0031] If the target email template is not in a disabled state, detecting whether the current flow control data exceeds a preset limit threshold based on the flow control rule;
[0032] If the current flow control data does not exceed the preset limit threshold, it is determined that the target email content has passed the verification that the email is allowed to be sent, otherwise it is determined that the target email content has not passed the verification that the email is allowed to be sent.
[0033] Further, after the step of detecting whether the current flow control data exceeds a preset limit threshold based on the flow control rule, the method further includes:
[0034] If the current flow control data exceeds the preset limit threshold, the sending of the target email content is suspended;
[0035] Generate a corresponding alarm notification based on the flow control data;
[0036] Get the preset alarm notification method;
[0037] Based on the alarm notification method, the alarm notification is sent to relevant personnel.
[0038] Furthermore, the step of executing the email sending process corresponding to the target email content specifically includes:
[0039] Establish a connection with the preset mail server;
[0040] Convert the target email content into a specified format corresponding to the email server to obtain the specified email content;
[0041] Call the preset mail processing client;
[0042] The designated email content is sent to the email server based on the email processing client.
[0043] Further, after the step of sending the specified email content to the email server based on the email processing client, the method further includes:
[0044] Receiving response information corresponding to the email sending process returned by the email server;
[0045] If the content of the response information is that the email sending failed, then obtain the preset retry strategy;
[0046] Retry the target email content based on the retry strategy to obtain a corresponding specified email sending result;
[0047] Performing status update processing on the target email sending task based on the specified email sending result;
[0048] The specified email sending result is returned to the user.
[0049] In order to solve the above technical problems, the embodiment of the present application further provides a mail processing device, which adopts the following technical solution:
[0050] A judgment module, used to judge whether to receive the email sending request triggered by the user;
[0051] A receiving module, used for displaying a preset email management interface and receiving email configuration information entered by the user in the email management interface and a selected target email template;
[0052] A verification module, used to verify the email configuration information;
[0053] A creation module, configured to create a corresponding target email sending task based on the email configuration information if the email configuration information passes the information verification;
[0054] An acquisition module, used for acquiring an HTML template file corresponding to the target email sending task from a preset file server when a sending time point corresponding to the target email sending task is reached;
[0055] A filling module, used to perform variable filling processing on the HTML template file based on the email configuration information to obtain corresponding target email content;
[0056] A verification module, used to verify the target email content to see if it is allowed to be sent based on a preset email sending management rule;
[0057] The sending module is used to execute the email sending process corresponding to the target email content if the target email content passes the email sending permission verification.
[0058] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0059] Determine whether to receive the email sending request triggered by the user;
[0060] If yes, display a preset email management interface, and receive the email configuration information entered by the user in the email management interface and the selected target email template;
[0061] Performing information verification on the email configuration information;
[0062] If the email configuration information passes the information verification, creating a corresponding target email sending task based on the email configuration information;
[0063] When the sending time point corresponding to the target email sending task is reached, the HTML template file corresponding to the target email sending task is obtained from a preset file server;
[0064] Perform variable filling processing on the HTML template file based on the email configuration information to obtain corresponding target email content;
[0065] Based on the preset mail sending management rules, verify the content of the target mail to see if it is allowed to be sent;
[0066] If the target email content passes the email sending permission verification, the email sending process corresponding to the target email content is executed.
[0067] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0068] Determine whether to receive the email sending request triggered by the user;
[0069] If yes, display a preset email management interface, and receive the email configuration information entered by the user in the email management interface and the selected target email template;
[0070] Performing information verification on the email configuration information;
[0071] If the email configuration information passes the information verification, creating a corresponding target email sending task based on the email configuration information;
[0072] When the sending time point corresponding to the target email sending task is reached, the HTML template file corresponding to the target email sending task is obtained from a preset file server;
[0073] Perform variable filling processing on the HTML template file based on the email configuration information to obtain corresponding target email content;
[0074] Based on the preset mail sending management rules, verify the content of the target mail to see if it is allowed to be sent;
[0075] If the target email content passes the email sending permission verification, the email sending process corresponding to the target email content is executed.
[0076] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0077] The present application first determines whether an email sending request triggered by a user is received; if so, a preset email management interface is displayed, and the email configuration information entered by the user in the email management interface and the selected target email template are received; then the email configuration information is verified; if the email configuration information passes the information verification, a corresponding target email sending task is created based on the email configuration information; when the sending time point corresponding to the target email sending task is reached, an HTML template file corresponding to the target email sending task is obtained from a preset file server; then, variable filling processing is performed on the HTML template file based on the email configuration information to obtain the corresponding target email content; subsequently, based on the preset email sending management rules, the target email content is verified to be allowed to be sent; if the target email content passes the verification to be allowed to be sent, the email sending processing corresponding to the target email content is executed. When receiving an email sending request triggered by a user, the present application automatically verifies the email configuration information by receiving the email configuration information input by the user in the email management interface and the selected target email template. Only when the email configuration information passes the information verification will the corresponding target email sending task be created based on the email configuration information, and the target email content corresponding to the email configuration information will be automatically generated based on the use of the HTML template file obtained from the file server. Subsequently, based on the preset email sending management rules, the target email content will be verified for email sending permission, and only when the target email content passes the verification for email sending permission will the email sending processing corresponding to the target email content be executed. In this way, the email generation and email sending processing corresponding to the email sending request triggered by the user are automatically and accurately completed, effectively improving the processing efficiency and accuracy of email sending. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0079] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0080] Figure 2 A flowchart of an embodiment of a mail processing method according to the present application;
[0081] Figure 3 is a structural schematic diagram of an embodiment of a mail processing device according to the present application;
[0082] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0083] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0084] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0085] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0086] like Figure 1As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0087] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0088] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop computer 1011, the tablet computer 1012 or the mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, a desktop computer, etc.
[0089] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0090] It should be noted that the mail processing method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the mail processing device is generally arranged in the server / terminal device.
[0091] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0092] Continue to refer Figure 2, shows a flow chart of an embodiment of the mail processing method according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The mail processing method provided in the embodiment of the present application can be applied to any scenario where mail processing is required, and the mail processing method can be applied to products in these scenarios, for example, mail sending processing in the financial insurance field. The mail processing method includes the following steps:
[0093] Step S201, determining whether an email sending request triggered by a user is received.
[0094] In this embodiment, the electronic device (eg, Figure 1 The server / terminal device shown in the figure) can obtain the email sending request through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi-Fi connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (Ultra Wi-Fi Band) connection, and other wireless connection methods currently known or to be developed in the future. The executor of the present application may specifically be a mail processing system, or simply referred to as the system. The above-mentioned email sending request is an application for email sending initiated by a user on the mail processing system. The mail processing system can be applied to financial enterprises, such as insurance companies, banks and other financial institutions in the processing scenarios of business work.
[0095] Step S202: If yes, display a preset email management interface, and receive the email configuration information entered by the user in the email management interface and the selected target email template.
[0096] In this embodiment, the above-mentioned email management interface is a pre-built interface for assisting users in email configuration and email sending. After receiving an email sending request, multiple preset email templates and configurable fields (such as email subject, variable placeholders in the body, etc.) will be displayed in the above-mentioned email management interface. Users can select the target email template to be sent from the above-mentioned email templates according to personal needs, and enter or select specific email configuration information. The above-mentioned email configuration information may at least include email content, sender and recipient information, and also include information such as sending time. In addition, users can also configure the retry mechanism, including whether to enable retry, the number of retries, the retry interval, etc.
[0097] Step S203: verify the email configuration information.
[0098] In this embodiment, the specific implementation process of the above-mentioned information verification of the email configuration information will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated in detail here.
[0099] Step S204: if the email configuration information passes the information verification, a corresponding target email sending task is created based on the email configuration information.
[0100] In this embodiment, according to the email configuration information configured by the user, the system will generate a target email sending task. The target email sending task may include key information such as email template ID, sending time, retry strategy, recipient list, etc. The target email sending task can be saved in a task queue, which can be a memory queue (such as a Redis queue) or a task table in a database. A unique task ID is assigned to each task for subsequent tracking and management.
[0101] Step S205, when the sending time point corresponding to the target email sending task is reached, the HTML template file corresponding to the target email sending task is obtained from a preset file server.
[0102] In this embodiment, there is a timer scheduler (such as Quartz) inside the system, which regularly checks the tasks in the task queue. When a task whose sending time has arrived is found, the scheduler takes the task out of the queue and prepares for execution. When it is detected that the sending time point corresponding to the target email sending task has arrived, the process of preparing to execute the template email sending task will be carried out. Specifically, by reading the detailed information of the target email sending task, and obtaining the email template ID based on the detailed information, the HTML template file corresponding to the email template ID is retrieved from the pre-built file server. Among them, the style and content of the email to be sent are made into an HTML template in advance and a embedding point is added, and then the HTML template is saved to the file server, and the HTML template can be adjusted at any time.
[0103] Step S206: Fill in variables on the HTML template file based on the email configuration information to obtain corresponding target email content.
[0104] In this embodiment, the above-mentioned specific implementation process of filling variables in the HTML template file based on the email configuration information to obtain the corresponding target email content will be further described in detail in subsequent specific embodiments of the present application, and will not be elaborated on here.
[0105] Step S207: Based on the preset email sending management rules, the target email content is verified to ensure that the email is allowed to be sent.
[0106] In this embodiment, the above-mentioned email sending management rules are global rules that are effective for all email templates. Among them, through subscription management, template rules can be specified to make the rules effective for some emails, such as template switches and role bindings. In addition, the specific implementation process of the above-mentioned verification processing of the target email content to allow email sending based on the preset email sending management rules will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0107] Step S208: If the target email content passes the email sending permission verification, the email sending process corresponding to the target email content is executed.
[0108] In this embodiment, the specific implementation process of executing the email sending processing corresponding to the target email content will be further described in detail in subsequent specific embodiments of the present application, and will not be elaborated on here.
[0109] The present application first determines whether an email sending request triggered by a user is received; if so, a preset email management interface is displayed, and the email configuration information entered by the user in the email management interface and the selected target email template are received; then the email configuration information is verified; if the email configuration information passes the information verification, a corresponding target email sending task is created based on the email configuration information; when the sending time point corresponding to the target email sending task is reached, an HTML template file corresponding to the target email sending task is obtained from a preset file server; then, variable filling processing is performed on the HTML template file based on the email configuration information to obtain the corresponding target email content; subsequently, based on the preset email sending management rules, the target email content is verified to be allowed to be sent; if the target email content passes the verification to be allowed to be sent, the email sending processing corresponding to the target email content is executed. When receiving an email sending request triggered by a user, the present application automatically verifies the email configuration information by receiving the email configuration information input by the user in the email management interface and the selected target email template. Only when the email configuration information passes the information verification will the corresponding target email sending task be created based on the email configuration information, and the target email content corresponding to the email configuration information will be automatically generated based on the use of the HTML template file obtained from the file server. Subsequently, based on the preset email sending management rules, the target email content will be verified for email sending permission, and only when the target email content passes the verification for email sending permission will the email sending processing corresponding to the target email content be executed. In this way, the email generation and email sending processing corresponding to the email sending request triggered by the user are automatically and accurately completed, effectively improving the processing efficiency and accuracy of email sending.
[0110] In some optional implementations, step S203 includes the following steps:
[0111] The email configuration information is analyzed to determine whether all required items are included in the email configuration information.
[0112] In this embodiment, the email configuration information is analyzed to check whether all the required fields in the email configuration information are filled in. The required fields can be set according to the actual email sending requirements, for example, including email template ID, sending time, recipient list and other fields.
[0113] If all the required items are included in the mail configuration information, it is determined whether the data format of the mail configuration information is in a correct format.
[0114] In this embodiment, the format of the email configuration information may be verified to verify whether the format of the email address, date and time included in the email configuration information is correct.
[0115] If yes, obtain the recipient information from the email configuration information.
[0116] In this embodiment, the required recipient information can be extracted by extracting the above-mentioned email configuration information.
[0117] Determine whether the recipient information exists in a preset blacklist.
[0118] In this embodiment, a blacklist configuration interface is developed in advance, allowing the administrator to enter IP addresses, user IDs, role names, etc. to set up corresponding blacklists and control the scope of email delivery. The blacklist data is stored in a database, supporting addition, deletion, modification, and query operations. In addition, blacklist fields can be set separately for global templates and specific templates in the database for flexible configuration.
[0119] If the recipient information does not exist in the blacklist, it is determined that the email configuration information passes the information verification; otherwise, it is determined that the email configuration information fails the information verification.
[0120] In this embodiment, if it is detected that the recipient information does not exist in the blacklist, it means that the recipient information is within the permitted range, and the email configuration information is determined to have passed the information verification. If it is detected that the recipient information exists in the blacklist, it means that the recipient information is not within the permitted range, and the email configuration information is determined to have failed the information verification, and the subsequent generation of the email sending task will be blocked.
[0121] The present application performs information analysis on the email configuration information to determine whether all mandatory items are included in the email configuration information; if all mandatory items are included in the email configuration information, then determine whether the data format of the email configuration information is in the correct format; if so, obtain the recipient information from the email configuration information; and subsequently determine whether the recipient information exists in a preset blacklist; if the recipient information does not exist in the blacklist, then determine that the email configuration information has passed the information verification, otherwise determine that the email configuration information has not passed the information verification. The present application performs mandatory item checking, format verification, and blacklist verification on the email configuration information, thereby combining multiple verification methods to intelligently and accurately complete the information verification of the email configuration information, thereby improving the accuracy and reliability of the information verification, and facilitating ensuring the information accuracy of the email configuration information.
[0122] In some optional implementations of this embodiment, step S206 includes the following steps:
[0123] The HTML template file is parsed to obtain corresponding variable placeholders.
[0124] In this embodiment, after the HTML template file is obtained, the variable placeholders in the HTML template file can be further parsed. These variable placeholders follow certain naming rules or patterns, such as ${user name}, %order_id%, etc.
[0125] A data value corresponding to the variable placeholder is extracted from the email configuration information.
[0126] In this embodiment, the actual data values corresponding to the various variable placeholders can be found from the above-mentioned email configuration information according to the variable placeholders obtained through analysis.
[0127] Call the default template engine.
[0128] In this embodiment, the template engine may specifically adopt an engine with a data replacement function.
[0129] Based on the template engine, the variable placeholders in the HTML template file are replaced with corresponding data values to obtain a processed HTML template file.
[0130] In this embodiment, the variable placeholders in the HTML template file can be replaced with corresponding actual data values by using a template engine, thereby obtaining the corresponding target email content, effectively ensuring the accuracy and efficiency of the replacement operation.
[0131] The processed HTML template file is used as the target email content.
[0132] In this embodiment, after obtaining the target email content, some additional checks may be further performed, such as verifying the validity of the recipient address, checking whether the email content contains sensitive information, etc., to ensure the security and compliance of the target email content.
[0133] The present application obtains the corresponding variable placeholders by parsing the HTML template file; then extracts the data values corresponding to the variable placeholders from the email configuration information; then calls a preset template engine, and based on the template engine, replaces the variable placeholders in the HTML template file with the corresponding data values to obtain a processed HTML template file; and subsequently uses the processed HTML template file as the target email content. The present application obtains the variable placeholders by parsing the HTML template file, and extracts the data values corresponding to the variable placeholders from the email configuration information, and then replaces the variable placeholders in the HTML template file with the corresponding data values based on the use of the template engine, thereby automatically and accurately obtaining the corresponding target email content, effectively ensuring the accuracy and efficiency of the replacement operation, and ensuring the data accuracy of the obtained target email content.
[0134] In some optional implementations, step S207 includes the following steps:
[0135] Load the email sending management rules corresponding to the email sending task.
[0136] In this embodiment, the above-mentioned email sending management rules at least include environment switch rules, template switch rules and flow control rules. Among them, the configuration process of the switch rules includes: pre-developing a switch rule configuration interface, allowing administrators to set environment switch rules, template switch rules, etc. And the switch status is stored in the database, supporting dynamic modification. And subsequently, the judgment of the switch status is added to the email sending logic, and whether to send the email is determined based on the switch status. The environment switch rule is used to check whether the current environment (such as development, testing, and production) allows sending. The template switch rule is used to check whether the sending of a specific template is disabled.
[0137] In addition, the configuration process of flow control rules includes: pre-developing a flow control rule configuration interface, allowing administrators to set flow control rules such as sending frequency, email size, number of recipients, and daily sending volume. The flow control rules are stored in the database and support dynamic modification. In the subsequent email sending process, various flow control indicators are monitored in real time, and when the threshold is reached, the corresponding processing logic is triggered (such as pausing sending, sending alarms, etc.). The flow control rules are used to check whether the current sending frequency, email size, number of recipients, etc. exceed the limit.
[0138] Based on the environment switch rule, it is detected whether the current environment allows sending emails.
[0139] In this embodiment, the rule content of the above environment switch rule can be executed to detect whether the current environment allows sending emails. If it is detected that the current environment does not allow sending emails, it is directly determined that the target email content does not pass the verification of allowing email sending.
[0140] If the current environment allows sending emails, then based on the template switch rule, it is detected whether the target email template is in a disabled state.
[0141] In this embodiment, the rule content of the template switch rule can be executed to detect whether the target email template is in a disabled state. If the target email template is detected to be in a disabled state, it is directly determined that the target email content has not passed the verification of email sending permission.
[0142] If the target email template is not in a disabled state, it is detected based on the flow control rule whether the current flow control data exceeds a preset limit threshold.
[0143] In this embodiment, the flow control data may include at least the current sending frequency, the email size, and the number of recipients. If any one of the current sending frequency, email size, and the number of recipients is greater than the preset corresponding limit threshold, the current flow control data is determined to exceed the limit threshold. Only when all the data in the current sending frequency, email size, and the number of recipients are less than the preset corresponding limit threshold, the current flow control data is determined not to exceed the limit threshold. There is no specific limitation on the value of the above limit threshold, which can be set according to actual business needs.
[0144] If the current flow control data does not exceed the preset limit threshold, it is determined that the target email content has passed the verification that the email is allowed to be sent, otherwise it is determined that the target email content has not passed the verification that the email is allowed to be sent.
[0145] In this embodiment, if the current flow control data passes the verification of all mail sending management rules, it is determined that the target mail content passes the verification of mail sending permission, otherwise it is determined that the target mail content does not pass the verification of mail sending permission.
[0146] The present application loads the email sending management rules corresponding to the email sending task; then detects whether the current environment allows email sending based on the environment switch rules; if the current environment allows email sending, then detects whether the target email template is in a disabled state based on the template switch rules; if the target email template is not in a disabled state, then detects whether the current flow control data exceeds the preset limit threshold based on the flow control rules; if the current flow control data does not exceed the preset limit threshold, then determines that the target email content has passed the verification that the email is allowed to be sent, otherwise determines that the target email content has not passed the verification that the email is allowed to be sent. The present application combines the use of the environment switch rules, template switch rules, and flow control rules corresponding to the email sending task to respectively process the target email content, thereby intelligently and accurately completing the verification process of the target email content to allow email sending, thereby improving the accuracy and reliability of the verification process of the target email content, and is conducive to ensuring the processing standardization and accuracy of email sending.
[0147] In some optional implementations, after the step of detecting whether the current flow control data exceeds a preset limit threshold based on the flow control rule, the following steps are also included:
[0148] If the current flow control data exceeds the preset limit threshold, the sending of the target email content is suspended.
[0149] In this embodiment, an alarm rule configuration interface is pre-developed to allow administrators to set alarm rules (such as pause sending processing when flow control rules are triggered, alarm method, alarm recipient, etc.). By adding alarm logic to the flow control logic, when the flow control rules are triggered, alarm notifications (such as SMS, email, etc.) are sent according to the configured alarm rules.
[0150] Generate a corresponding alarm notification based on the flow control data.
[0151] In this embodiment, the abnormal flow control data exceeding the corresponding limit threshold can be screened out from the above flow control data, and then the abnormal flow control data can be filled into the preset alarm notification template to generate the corresponding alarm notification. The above alarm notification template is pre-built according to the actual alarm notification requirements.
[0152] Get the preset alarm notification method.
[0153] In this embodiment, the above-mentioned alarm notification method may include text messages, emails, etc.
[0154] Based on the alarm notification method, the alarm notification is sent to relevant personnel.
[0155] In this embodiment, the above-mentioned relevant personnel are pre-configured alarm recipients.
[0156] If the present application detects that the current flow control data exceeds the preset limit threshold, the sending of the target email content will be suspended; then a corresponding alarm notification will be generated based on the flow control data; then a preset alarm notification method will be obtained; and subsequently, the alarm notification will be sent to relevant personnel based on the alarm notification method. If the present application detects that the current flow control data exceeds the preset limit threshold, the sending of the target email content will be suspended intelligently first, and the corresponding alarm notification will be automatically generated based on the flow control data, and then the alarm notification will be sent to relevant personnel based on the obtained alarm notification method, so that relevant personnel can intervene and handle the current faults of the system in a timely manner after consulting the alarm notification, which is conducive to ensuring the stable operation of the system.
[0157] In some optional implementations of this embodiment, step S208 includes the following steps:
[0158] Establish a connection with the preset mail server.
[0159] In this embodiment, the mail server may specifically be an SMTP server, and the configuration information of the SMTP server (such as server address, port, authentication information, etc.) is preloaded, and then the SMTP protocol is used to establish a connection with the mail server.
[0160] The target email content is converted into a specified format corresponding to the email server to obtain the specified email content.
[0161] In this embodiment, the above-mentioned specified format refers to the format required by the SMTP protocol. After successfully establishing a connection with the mail server, the specified mail content is obtained by converting the target mail content into the format required by the SMTP protocol.
[0162] Invoke the default mail processing client.
[0163] In this embodiment, the mail processing client may specifically be an SMTP client.
[0164] The designated email content is sent to the email server based on the email processing client.
[0165] In this embodiment, the specified email content can be sent to the email server through the email processing client according to the successfully established connection, and wait for the response of the email server (SMTP server). If the email server successfully receives the email, it will return a successful status code (successful email sending); if the email fails to send (such as the recipient address does not exist, the email size exceeds the limit, etc.), the error is recorded and corresponding error handling measures are taken.
[0166] The present application establishes a connection with a preset mail server; then converts the target mail content into a specified format corresponding to the mail server to obtain the specified mail content; then calls a preset mail processing client; and subsequently sends the specified mail content to the mail server based on the mail processing client. The present application establishes a connection with a preset mail server, converts the target mail content into a specified format corresponding to the mail server to obtain the specified mail content, and then calls a preset mail processing client to send the specified mail content to the mail server, thereby automatically and accurately completing the mail sending processing corresponding to the target mail content, ensuring the processing standardization and processing intelligence of the mail sending processing.
[0167] In some optional implementations of this embodiment, after the step of sending the specified email content to the email server based on the email processing client, the following steps are also included:
[0168] Receive response information corresponding to the mail sending process returned by the mail server.
[0169] In this embodiment, the content of the above response information may include email sending success or email sending failure.
[0170] If the content of the response information is that the email sending fails, a preset retry strategy is obtained.
[0171] In this embodiment, the retry strategy may include a predefined number of retries and a retry interval.
[0172] The target email content is retried based on the retry strategy to obtain a corresponding designated email sending result.
[0173] In this embodiment, the target email content can be retried according to the number of retries and the retry interval included in the above retry strategy, and the final email sending result, that is, the above specified email sending result, can be obtained. Among them, detailed exception information of each sending attempt can be recorded, including exception type, stack trace, etc. If the sending fails after reaching the maximum number of retries, the final failure log is recorded, and whether to send an alarm notification is determined according to the configuration.
[0174] A status update process is performed on the target email sending task based on the specified email sending result.
[0175] In this embodiment, the specified email sending result may be used to update the original status of the target email sending task to complete the status update process.
[0176] The specified email sending result is returned to the user.
[0177] In this embodiment, the designated email sending result may be returned to the user by email, text message, system notification or page display.
[0178] The present application receives the response information corresponding to the mail sending process returned by the mail server; if the content of the response information is that the mail sending fails, a preset retry strategy is obtained; then the target mail content is retried based on the retry strategy to obtain the corresponding specified mail sending result; then the target mail sending task is updated based on the specified mail sending result; and the specified mail sending result is subsequently returned to the user. After the present application sends the specified mail content to the mail server based on the mail processing client, if the content of the response information corresponding to the mail sending process returned by the mail server is that the mail sending fails, the target mail content is automatically and intelligently retried based on the preset retry strategy, thereby helping to improve the success rate of mail sending and improve the intelligence of mail sending. And the target mail sending task is also updated according to the obtained specified mail sending result, thereby realizing the automatic update of the status of the target mail sending task. And the specified mail sending result is returned to the user so that the user can timely understand the mail sending situation, which is conducive to improving the user's experience.
[0179] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.
[0180] In addition, point logs can be written during email sending, retrying, exceptions, and user operations to collect unstructured data including user operations, sending logs, exception logs, and alarm logs. After offline analysis, the data is stored in a relational database, allowing for full-process monitoring of sending tasks, rapid discovery of faults, saving troubleshooting time, rapid resumption of production, and rapid traceability of abnormal problems.
[0181] In addition, the email processing method of this application does not require publishing, and can replace email content and page embedding points online; it also supports common email sending scenarios and can flexibly support rule configuration: the system has inventoried common rules, and for each type of rule, corresponding parsers are written, and new rules can be inserted into new parsers, supporting rule expansion. In addition, email tasks are assembled from templates, rules, and configurations. After the task is generated, it is sent to the point. Before sending, the task can be modified, including content, sender and recipient, verification rules, etc., to flexibly respond to business needs.
[0182] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0183] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target email content, the above-mentioned target email content can also be stored in a blockchain node.
[0184] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0185] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0186] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0187] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0188] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0189] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a mail processing device, and the embodiment of the device is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0190] like Figure 3 As shown, the mail processing device 300 described in this embodiment includes: a judgment module 301, a receiving module 302, a verification module 303, a creation module 304, an acquisition module 305, a filling module 306, a verification module 307 and a sending module 308. Among them:
[0191] The judgment module 301 is used to judge whether to receive the email sending request triggered by the user;
[0192] The receiving module 302 is used to display a preset email management interface and receive the email configuration information and the selected target email template input by the user in the email management interface;
[0193] Verification module 303, used to verify the email configuration information;
[0194] A creation module 304 is used to create a corresponding target email sending task based on the email configuration information if the email configuration information passes the information verification;
[0195] The acquisition module 305 is used to acquire the HTML template file corresponding to the target email sending task from a preset file server when the sending time point corresponding to the target email sending task is reached;
[0196] A filling module 306 is used to perform variable filling processing on the HTML template file based on the email configuration information to obtain corresponding target email content;
[0197] Verification module 307, used for verifying the target email content to see if it is allowed to be sent based on a preset email sending management rule;
[0198] The sending module 308 is configured to execute the email sending process corresponding to the target email content if the target email content passes the email sending permission verification.
[0199] In some optional implementations of this embodiment, the verification module 303 includes:
[0200] A first judgment submodule is used to analyze the email configuration information to determine whether the email configuration information contains all required items;
[0201] A second judgment submodule is used to judge whether the data format of the email configuration information is a correct format if all the required items are included in the email configuration information;
[0202] A first acquisition submodule, used for, if yes, acquiring recipient information from the email configuration information;
[0203] The third judgment submodule is used to judge whether the recipient information exists in a preset blacklist;
[0204] The first determination submodule is used to determine that the email configuration information passes the information verification if the recipient information does not exist in the blacklist, and otherwise determine that the email configuration information fails the information verification.
[0205] In some optional implementations of this embodiment, the filling module 306 includes:
[0206] A parsing submodule, used to parse the HTML template file to obtain corresponding variable placeholders;
[0207] An extraction submodule, used to extract data values corresponding to the variable placeholders from the email configuration information;
[0208] The first calling submodule is used to call the preset template engine;
[0209] A replacement submodule, used for replacing the variable placeholders in the HTML template file with corresponding data values based on the template engine to obtain a processed HTML template file;
[0210] A submodule is determined, which is used to use the processed HTML template file as the target email content.
[0211] In some optional implementations of this embodiment, the verification module 307 includes:
[0212] A loading submodule, used to load the email sending management rules corresponding to the email sending task; wherein the email sending management rules at least include environment switch rules, template switch rules and flow control rules;
[0213] A first detection submodule, used for detecting whether the current environment allows sending emails based on the environment switch rule;
[0214] A second detection submodule, configured to detect whether the target email template is in a disabled state based on the template switch rule if the current environment allows email sending;
[0215] A third detection submodule, configured to detect whether the current flow control data exceeds a preset limit threshold based on the flow control rule if the target email template is not in a disabled state;
[0216] The second determination submodule is used to determine that the target email content has passed the verification that the email is allowed to be sent if the current flow control data does not exceed the preset limit threshold, otherwise determine that the target email content has not passed the verification that the email is allowed to be sent.
[0217] In some optional implementations of this embodiment, the verification module 307 further includes:
[0218] A processing submodule, used for suspending the sending of the target email content if the current flow control data exceeds a preset limit threshold;
[0219] A generating submodule, used for generating a corresponding alarm notification based on the flow control data;
[0220] The second acquisition submodule is used to obtain a preset alarm notification method;
[0221] The first sending submodule is used to send the alarm notification to relevant personnel based on the alarm notification method.
[0222] In some optional implementations of this embodiment, the sending module 308 includes:
[0223] A connection submodule is used to establish a connection with a preset mail server;
[0224] A conversion submodule, used to convert the target email content into a specified format corresponding to the email server to obtain the specified email content;
[0225] The second calling submodule is used to call the preset mail processing client;
[0226] The second sending submodule is used to send the designated email content to the email server based on the email processing client.
[0227] In some optional implementations of this embodiment, the sending module 308 further includes:
[0228] A receiving submodule, used for receiving the response information corresponding to the email sending process returned by the email server;
[0229] The third acquisition submodule is used to acquire a preset retry strategy if the content of the response information is that the email sending fails;
[0230] A retry submodule, used to retry the target email content based on the retry strategy to obtain a corresponding specified email sending result;
[0231] An updating submodule, used for performing a status update process on the target email sending task based on the specified email sending result;
[0232] The return submodule is used to return the specified email sending result to the user.
[0233] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0234] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0235] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0236] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the mail processing method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0237] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the mail processing method.
[0238] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0239] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the mail processing method as described above.
[0240] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0241] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A mail processing method, characterized in that: The steps include: Determine whether to receive the email sending request triggered by the user; If yes, display a preset email management interface, and receive the email configuration information entered by the user in the email management interface and the selected target email template; Performing information verification on the email configuration information; If the email configuration information passes the information verification, creating a corresponding target email sending task based on the email configuration information; When the sending time point corresponding to the target email sending task is reached, the HTML template file corresponding to the target email sending task is obtained from a preset file server; Perform variable filling processing on the HTML template file based on the email configuration information to obtain corresponding target email content; Based on the preset mail sending management rules, verify the content of the target mail to see if it is allowed to be sent; If the target email content passes the email sending permission verification, the email sending process corresponding to the target email content is executed.
2. The mail processing method according to claim 1, characterized in that: The step of verifying the email configuration information specifically includes: Analyze the email configuration information to determine whether all required items are included in the email configuration information; If all the required items are included in the email configuration information, determining whether the data format of the email configuration information is in a correct format; If yes, obtaining recipient information from the email configuration information; Determine whether the recipient information exists in a preset blacklist; If the recipient information does not exist in the blacklist, it is determined that the email configuration information passes the information verification; otherwise, it is determined that the email configuration information fails the information verification.
3. The mail processing method according to claim 1, characterized in that: The step of performing variable filling processing on the HTML template file based on the email configuration information to obtain the corresponding target email content specifically includes: Parsing the HTML template file to obtain corresponding variable placeholders; Extracting a data value corresponding to the variable placeholder from the email configuration information; Call the preset template engine; Based on the template engine, the variable placeholders in the HTML template file are replaced with corresponding data values to obtain a processed HTML template file; The processed HTML template file is used as the target email content.
4. The mail processing method according to claim 1, characterized in that: The step of performing verification processing on the target email content to determine whether the email is allowed to be sent based on the preset email sending management rules specifically includes: Loading the email sending management rules corresponding to the email sending task; wherein the email sending management rules at least include environment switch rules, template switch rules and flow control rules; Detecting whether the current environment allows sending emails based on the environment switch rule; If the current environment allows sending emails, detecting whether the target email template is in a disabled state based on the template switch rule; If the target email template is not in a disabled state, detecting whether the current flow control data exceeds a preset limit threshold based on the flow control rule; If the current flow control data does not exceed the preset limit threshold, it is determined that the target email content has passed the verification that the email is allowed to be sent, otherwise it is determined that the target email content has not passed the verification that the email is allowed to be sent.
5. The mail processing method according to claim 4, characterized in that: After the step of detecting whether the current flow control data exceeds a preset limit threshold based on the flow control rule, the method further includes: If the current flow control data exceeds the preset limit threshold, the sending of the target email content is suspended; Generate a corresponding alarm notification based on the flow control data; Get the preset alarm notification method; Based on the alarm notification method, the alarm notification is sent to relevant personnel.
6. The mail processing method according to claim 1, characterized in that: The step of executing the email sending process corresponding to the target email content specifically includes: Establish a connection with the preset mail server; Convert the target email content into a specified format corresponding to the email server to obtain the specified email content; Call the preset mail processing client; The designated email content is sent to the email server based on the email processing client.
7. The mail processing method according to claim 6, characterized in that: After the step of sending the specified email content to the email server based on the email processing client, the method further includes: Receiving response information corresponding to the email sending process returned by the email server; If the content of the response information is that the email sending failed, then obtain the preset retry strategy; Retry the target email content based on the retry strategy to obtain a corresponding specified email sending result; Performing status update processing on the target email sending task based on the specified email sending result; The specified email sending result is returned to the user.
8. A mail processing device, characterized in that: include: A judgment module, used to judge whether to receive the email sending request triggered by the user; A receiving module, used for displaying a preset email management interface and receiving email configuration information entered by the user in the email management interface and a selected target email template; A verification module, used to verify the email configuration information; A creation module, configured to create a corresponding target email sending task based on the email configuration information if the email configuration information passes the information verification; An acquisition module, used for acquiring an HTML template file corresponding to the target email sending task from a preset file server when a sending time point corresponding to the target email sending task is reached; A filling module, used to perform variable filling processing on the HTML template file based on the email configuration information to obtain corresponding target email content; A verification module, used to verify the target email content to see if it is allowed to be sent based on a preset email sending management rule; The sending module is used to execute the email sending process corresponding to the target email content if the target email content passes the email sending permission verification.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the mail processing method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the mail processing method according to any one of claims 1 to 7 are implemented.