CN111464425B - Mail generation method, device, equipment and storage medium - Google Patents
Mail generation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111464425B CN111464425B CN202010182261.5A CN202010182261A CN111464425B CN 111464425 B CN111464425 B CN 111464425B CN 202010182261 A CN202010182261 A CN 202010182261A CN 111464425 B CN111464425 B CN 111464425B
- Authority
- CN
- China
- Prior art keywords
- display
- template
- file
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/42—Mailbox-related aspects, e.g. synchronisation of mailboxes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/10—Office automation; Time management
- G06Q10/107—Computer-aided management of electronic mailing [e-mailing]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/56—Unified messaging, e.g. interactions between e-mail, instant messaging or converged IP messaging [CPM]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Human Resources & Organizations (AREA)
- Entrepreneurship & Innovation (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Data Mining & Analysis (AREA)
- Economics (AREA)
- Computer Hardware Design (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Information Transfer Between Computers (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to the technical field of big data processing, and discloses a mail generating method, which is characterized in that according to the type information of a sent mail, the identification mark of a corresponding mail template is inquired, the corresponding mail template is called based on the identification mark, the channel information of the sent mail is acquired, the size information of a corresponding carrier is acquired according to the channel information, the mail template is adjusted, finally, the adjusted mail template is converted into a mail template in a PDF format, and a mail file is generated based on the mail text; the invention also provides a mail generating device, equipment and a storage medium, thereby realizing that all mail templates are converted into the templates in a PDF format, so that staff does not need to maintain each template during maintenance, only needs to maintain the final PDF format file, and a user is convenient and visual during calling, and the use experience of the user is improved.
Description
Technical Field
The present invention relates to the field of big data processing technologies, and in particular, to a mail generating method, device, equipment, and computer readable storage medium.
Background
With the continuous development of computer application technology, communication of mail has become an important approach in work, but different clients or different businesses have special requirements on the format of the text of the mail, so that business personnel need frequent editing, such as mail, in order to avoid the need of frequently creating mail and inputting repeated mail contents by the business personnel, mail platform developers develop corresponding mail templates for personnel of the business departments, thereby enabling the business personnel to generate and send e-mails according to the mail templates.
At present, along with the continuous increase of business, the number of mail templates is also increasing, and the display formats of the templates are fixedly arranged, the display of the templates is not changed along with the change of display equipment, so that the display of different display equipment is different from the display of an actual template, and finally, business personnel need to adjust the templates, thereby greatly reducing the use experience of users, and meanwhile, too many mail templates increase the maintenance difficulty of mails, and are inconvenient for the service of business mails.
Disclosure of Invention
The invention mainly aims to provide a mail generation method, a mail generation device, mail generation equipment and a computer readable storage medium, and aims to solve the technical problems that the existing mail templates are too many, and output and maintenance of mail in later stages are inconvenient.
In order to achieve the above object, the present invention provides a mail generating method applied to a mail managing and controlling system, the mail generating method comprising the steps of:
receiving request information for sending mails, wherein the request information carries type information for indicating the sent mails;
inquiring the identification corresponding to the type information from a preset corresponding relation table according to the type information and the corresponding relation between the type information and the identification of the mail template;
extracting mail templates corresponding to the type information from a preset template storage position according to the identification mark, and storing mail templates of at least one type of mail in the template storage position;
determining channel information to be used when sending the mail according to the request information, wherein the channel information comprises an online channel and an offline channel;
acquiring size information of a carrier bearing the content of the mail template according to the channel information;
extracting a mail text specified in the request information, wherein the mail text comprises recipient information and mail content;
the mail template is subjected to visualization processing to obtain a display file in an HTML format, the display format of the display file is adjusted according to the size information, and the display file is converted into a PDF format file, wherein the display format comprises the display size of the display file and the display position of the content in the display file;
And updating the variable in the PDF format file according to the mail text to generate a mail file.
Optionally, the step of obtaining the display file in the HTML format by the visualization processing of the mail template includes:
analyzing the mail template to analyze variables and specified contents in the mail template;
obtaining a corresponding mail structured language template according to the variable and the specified content, converting the specified content into an HTML code by using the language template, and inserting the variable into the HTML code;
and generating a text file corresponding to the mail template according to the HTML code.
Optionally, the adjusting the display format of the display file according to the size information and converting to a PDF format file includes:
calculating display positions of the specified content and the variable in the text file respectively to obtain corresponding display layout;
and calculating the specific display positions of the variables and the specified contents on the carrier according to the size information and the display layout, and converting the adjusted text file into a PDF function.
Optionally, the obtaining, according to the channel information, size information of a carrier carrying contents of the mail template includes:
If the channel information is determined to be an online channel, selecting an application program for sending the mail according to the channel information;
and acquiring the display size of the mail editing interface of the application program and the display resolution of the terminal running the application program.
Optionally, said calculating a specific display position of said variable and said prescribed content on said carrier according to said size information and said display layout, and converting said text file after adjustment into a PDF function comprises:
calculating specific display positions of the variables and the specified contents on the terminal according to the display size, the display resolution and the display layout;
according to the specific display position, adjusting the display position of the variable and the specified content displayed in the text file in a mode of adding or deleting blank characters, wherein the blank characters comprise at least one of space characters and carriage return characters;
and converting the adjusted text file into the PDF mail through a preset HTML conversion PDF tool.
Optionally, the obtaining, according to the channel information, size information of a carrier carrying contents of the mail template includes:
If the channel information is determined to be an off-line channel, selecting and outputting printing equipment of the mail according to the channel information;
and acquiring the size and the printing direction of the printing paper of the printing output set in the printing equipment.
Optionally, said calculating a specific display position of said variable and said prescribed content on said carrier according to said size information and said display layout, and converting said text file after adjustment into a PDF function comprises:
calculating the number of words displayed by each row and the number of columns of the display of the variable and the specified content in the printing paper according to the size and the display layout;
according to the number of words displayed in each row and the number of columns displayed, carrying out layout adjustment on the variable and the specified content displayed in the text file according to the printing direction, wherein the adjustment is that blank characters are inserted or deleted, and the blank characters comprise at least one of blank characters and carriage return characters;
and converting the adjusted text file into the PDF mail through a preset HTML conversion PDF tool.
In addition, in order to achieve the above object, the present invention also provides a mail generating apparatus including:
The receiving module is used for receiving request information for sending the mail, wherein the request information carries type information for indicating the sent mail;
the inquiring module is used for inquiring the identification corresponding to the type information from a preset corresponding relation table according to the corresponding relation among the type information, the type information and the identification of the mail template; extracting mail templates corresponding to the type information from a preset template storage position according to the identification mark, and storing mail templates of at least one type of mail in the template storage position;
the communication module is used for determining channel information to be used when the mail is sent according to the request information, wherein the channel information comprises an online channel and an offline channel;
the acquisition module is used for acquiring the size information of the carrier bearing the content of the mail template according to the channel information;
the analysis module is used for extracting a mail text specified in the request information, wherein the mail text comprises recipient information and mail content;
the conversion module is used for obtaining a display file in an HTML format through visual processing of the mail template, adjusting the display format of the display file according to the size information, and converting the display file into a PDF format file, wherein the display format comprises the display size of the display file and the display position of the content in the display file;
And the mail generating module is used for updating the variable in the PDF format file according to the mail text to generate a mail file.
Optionally, the conversion module includes an extraction unit, a transcoding unit, and a text generation unit, wherein:
the extraction unit is used for analyzing the mail template and analyzing variables and specified contents in the mail template;
the code conversion unit is used for obtaining a corresponding mail structured language template according to the variable and the specified content, converting the specified content into HTML codes by utilizing the language template, and inserting the variable into the HTML codes;
and the text generation unit is used for generating a text file corresponding to the mail template according to the HTML code.
Optionally, the conversion module further includes a display adjustment unit and a PDF conversion unit, where:
the display adjustment unit is used for calculating the display positions of the specified content and the variable in the text file respectively to obtain corresponding display layout;
the PDF conversion unit is used for calculating the specific display positions of the variable and the specified content on the carrier according to the size information and the display layout, and converting the adjusted text file into a PDF function.
Optionally, the collection module is configured to select, when determining that the channel information is an online channel, an application program for sending the mail according to the channel information; and acquiring the display size of the mail editing interface of the application program and the display resolution of the terminal running the application program.
Optionally, the PDF conversion unit is configured to calculate a specific display position of the variable and the specified content on the terminal according to the display size, the display resolution, and the display layout; according to the specific display position, adjusting the display position of the variable and the specified content displayed in the text file in a mode of adding or deleting blank characters, wherein the blank characters comprise at least one of space characters and carriage return characters; and converting the adjusted text file into the PDF mail through a preset HTML conversion PDF tool.
Optionally, the collecting module is used for selecting and outputting the printing equipment of the mail according to the channel information when the channel information is determined to be an off-line channel; and acquiring the size and the printing direction of the printing paper of the printing output set in the printing equipment.
Optionally, the PDF conversion unit is configured to calculate, according to the size and the display layout, the number of words and the number of columns of display of the variable and the prescribed content for each line in the printing paper; according to the number of words displayed in each row and the number of columns displayed, carrying out layout adjustment on the variable and the specified content displayed in the text file according to the printing direction, wherein the adjustment is that blank characters are inserted or deleted, and the blank characters comprise at least one of blank characters and carriage return characters; and converting the adjusted text file into the PDF mail through a preset HTML conversion PDF tool.
In addition, to achieve the above object, the present invention also provides a computer apparatus including: memory, a processor, and computer readable instructions stored on the memory and executable on the processor, which when executed by the processor, implement the steps of the mail generation method as claimed in any one of the preceding claims.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon computer-readable instructions which, when executed by one or more processors, implement the steps of the mail generating method as set forth in any one of the above.
The invention provides a mail generating method, which is characterized in that according to the type information of a sent mail, the identification mark of a corresponding mail template is inquired, the corresponding mail template is called based on the identification mark, the channel information of the sent mail is obtained, the size information of a corresponding carrier is obtained according to the channel information to regulate the mail template, finally, the regulated mail template is converted into a PDF format mail template, the PDF format fixes the content display position in the mail template, so that the display difference can not occur when a business person calls, all the mail templates are converted into PDF format templates, the staff does not need to maintain the final PDF format file for each template during maintenance, and the user is convenient and visual during the calling, thereby improving the use experience of the user.
Drawings
FIG. 1 is a schematic diagram of an operation environment of a mail control platform according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a first embodiment of a mail generating method provided by the present invention;
FIG. 3 is a schematic diagram of a detailed flow of the step of converting PDF files provided by the invention;
Fig. 4 is a schematic flow chart of a second embodiment of the mail generating method provided by the invention;
FIG. 5 is a schematic diagram of a mail template according to the present invention;
FIG. 6 is a schematic diagram of a functional module of an embodiment of a mail generating device according to the present invention;
fig. 7 is a schematic diagram of another embodiment of the mail control platform provided by the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a mail control platform, referring to fig. 1, fig. 1 is a schematic structural diagram of an operation environment of the mail control platform according to an embodiment of the invention.
As shown in fig. 1, the mail control platform includes: a processor 101, e.g. a CPU, a communication bus 102, a user interface 103, a network interface 104, a memory 105. Wherein the communication bus 102 is used to enable connected communication between these components. The user interface 103 may comprise a Display, an input unit such as a Keyboard (Keyboard), and the network interface 104 may optionally comprise a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 105 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 105 may alternatively also be a storage device separate from the aforementioned processor 101.
It will be appreciated by those skilled in the art that the hardware configuration of the mail control platform shown in fig. 1 does not constitute a limitation of the mail generating apparatus and the computer device in the present invention, and may include more or less components than illustrated, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 1, an operating system, network communication program modules, user interface program modules, and computer readable instructions for implementing a mail generation method may be included in the memory 105 as one type of computer readable storage medium. The operating system schedules communication among the modules in the mail control platform and executes computer readable instructions stored in a memory to realize output conversion processing of a unified format of the mail to be sent on the mail platform or the mail APP.
In the hardware architecture of the mail control platform shown in fig. 1, the network interface 104 is mainly used for accessing the network; the user interface 103 is mainly used for monitoring and acquiring mail data to be sent, wherein the mail data may be online mails or offline mails, and the processor 101 may be used for calling computer readable instructions stored in the memory 105 and performing the operations of the following embodiments of the mail generating method.
Based on the hardware structure of the mail control platform, various embodiments of the mail generation method of the present invention are provided.
Referring to fig. 2, fig. 2 is a flowchart of a mail generating method according to an embodiment of the present invention. In this embodiment, the method is applied to a mail control platform, by dividing all mail service types into two types, namely on-line and off-line, based on the two types, acquiring size information of a corresponding carrier, adjusting a mail template, converting the adjusted mail template into a mail template in a PDF format, and finally updating a mail text according to the mail template in the PDF format to obtain a mail file in a single format, where the mail generation method specifically includes the following steps:
step S210, receiving request information for sending mail;
in this step, the request information may be a request for sending a mail triggered by a user terminal, or may be a request for sending a timed mail message triggered automatically by a platform or a system and an APP, where the request information carries type information for indicating the sent mail, and the mail may be understood to include an online email and an offline mail, for example, a mail sent through the internet by an application program such as a mailbox APP, or a mail sent by way of express delivery.
In this embodiment, the request carries the recipient information and the designated transmission content, such as attachment, linking website, etc., and may even be specific explanatory text, etc.
In practical application, the request is specifically touch operation of the user on the interface for sending the mail, and the corresponding text is selected from the interface through the touch operation, so as to generate a request instruction of a corresponding mail type, for example, a title of a plurality of service mails is set on the interface, the title is connected with a corresponding mail template, and the terminal identifies the type information of the mail requested to be sent by the user by clicking the position of the title and detecting the clicking operation.
Step S220, inquiring the identification corresponding to the type information from a preset corresponding relation table according to the corresponding relation among the type information, the type information and the identification of the mail template;
in practical application, the mail templates are fixed templates preset by users according to different services, after the templates are set, the templates are stored in fixed positions, corresponding IDs are set for the fixed templates, a table is generated, the correspondence between type information and the IDs is stored in the table, the terminal queries the table through the type information to obtain the corresponding IDs, and the corresponding templates are called based on the IDs.
Preferably, the fixed template is embodied in the form of a code in the storage location, that is, the terminal will convert the fixed template into a code program for storage when stored. For example:
"honored client, your good-!
The xxx insurance you apply will expire on xxx day, if renewal is needed, please complete renewal as soon as possible, thank you for-! ".
Step S230, extracting mail templates corresponding to the type information from a preset template storage position according to the identification mark, and storing mail templates of at least one type of mail in the template storage position;
in this embodiment, the preset template storage location stores template codes corresponding to different types of mails respectively, where the template codes may be specific mail templates corresponding to type information. For example, if the acquired type information is a medical insurance service, the extracted mail template is a code of a mail template of the medical insurance service corresponding to the mail to be output, and a corresponding mail text template can be generated based on the code.
Step S240, determining channel information to be used when sending the mail according to the request information, wherein the channel information comprises an online channel and an offline channel;
in this embodiment, since the sending of the mail is divided into two transmission modes, one is sending through the internet, that is, an online channel, and the other is sending through a express way, that is, an offline channel, different transmission modes need to make different adjustments to the mail template.
Step S250, acquiring size information of a carrier bearing the content of the mail template according to the channel information;
in this embodiment, the carrier refers to a manner of editing the text of the mail, and specifically includes two manners, one is displayed on the display interface of the display device, the other is directly printed by the printing device, the display manner on the display interface has different display differences, the printing is performed according to the layout rule of the template, but the size of the paper is fixed, so that there may be a case of asymmetry with the rule of the template, and therefore, the size of the actual carrier is acquired to adjust the rule size of the template.
Step S260, extracting a mail text specified in the request information, wherein the mail text comprises recipient information and mail content;
in this step, the mail content is specifically a different mail description for different business or customer settings, and may even be an attachment or a link, etc.
Step S270, the mail template is subjected to visualization processing to obtain a display file in an HTML format, the display format of the display file is adjusted according to the size information, and the display file is converted into a PDF format file, wherein the display format comprises the display size of the display file and the display position of the content in the display file;
in this step, the visualization processing means compiling the mail template code in a preview display manner to obtain a displayable HTML file, where the HTML file is compiled based on a default display size as a display standard, and the HTML file is a display file.
In the present embodiment, the adjustment here specifically refers to adjustment of the display format of the display content in the mail template, for example: the template "honored customer," you good-! The xxx insurance you apply will expire on xxx day, if renewal is needed, please complete renewal as soon as possible, thank you for-! "may be displayed in one or more lines, which may be not neat for viewing by a person, and may be displayed in another display format on the recipient's device after the recipient receives the message, where the display format is not uniform, and thus, after the size of the sender's device display is used to adjust the template, the display format is directly fixed, specifically adjusted as follows:
"honored clients:
your good-!
The xxx insurance you apply will expire on xxx day, if renewal is needed, please complete renewal as soon as possible, thank you for-! "
In practical application, the adjustment of the display is performed according to the display size of the display device actually carrying the mail template, specifically, the display word number of each line of the display device is calculated through size information, the length and width of the actual display are calculated based on the display word number, the length and width of the display are compared with the length and width required to be occupied by the content defined by the HTML characters in the display file, in the process of comparison, the total length of the word number of each line defined by the HTML characters in the display file is determined by considering the use of the carriage return mark and the skip mark, so that the adjustment strategy of the display file is determined, the display format of the display file is adjusted based on the adjustment strategy, the display file meeting the display device actually displaying the mail template is obtained, and then the display file is converted into PDF, so that the immobilization processing of the format of the template is realized.
Then, the mail template is fixed and displayed according to the adjusted display format, specifically, the display format is fixed by converting the mail template into a file with a PDF format, and of course, the display format is not necessarily fixed by the PDF format, and the mail template may be fixed by converting the mail template into a picture, that is, the adjusted display format may be fixed as long as the adjusted display format is fixed.
In the step, after the file is converted into the file with the fixed display format, the file with the PDF format is converted into the letter attachment of the mail, and the letter attachment exists in the mail in the form of the attachment, at this time, since the mail already exists as the attachment, when a business person sends the mail, the business person only needs to carry out simple content editing to explain and inform that the attachment is the specific content of the mail, so that the multi-template sending of the mail can be unified, the editing is not needed one by one, the processing efficiency of the business mail is greatly improved, and the post maintenance of maintenance personnel is also facilitated.
In practical application, the method includes the steps of converting PDF, identifying the variable area in the display file, marking the area, converting PDF, identifying the mark when writing the mail based on the PDF, generating a filling form at the position of the mark, filling the content to be filled in the form, and finally outputting a final mail file, wherein the mail file is still a PDF file and not an HTML file.
And step S280, updating the variable in the PDF format file according to the mail text, and generating a mail file.
In this step, the update processing here is to make a change based on the converted file of the fixed display format, for example:
"honored Mr. plum:
your good-!
The medical insurance applied by you will expire on 8 months and 10 days in 2018, if the warranty is needed, please complete the warranty procedure as soon as possible, thank for-! ".
In practical application, for the position of the variable, the position is displayed in the template with an underlined blank interval, the content of the variable resolved from the request can be realized by directly replacing the blank interval at the corresponding position in the template, and finally, the updated file in the PDF format is converted into an attachment of the mail, and the editing interface for sending the mail is popped up.
In practical application, the mail template is stored in a code manner, and when the mail template is invoked and used, the processor converts the code into an actual mail text file to display, and when the parameters of the display device are different from the display parameters of the template, the template is appropriately adjusted, and the adjustment can be based on the mail text file or based on the code.
In this embodiment, the preferred selection is adjusted based on the text of the mail body, that is, based on the mail template, and the specific implementation steps of the adjustment are as shown in fig. 3:
Step S271, analyzing the mail template, and analyzing variables and specified contents in the mail template;
step S272, obtaining a corresponding mail structured language template according to the variable and the specified content, converting the specified content into HTML codes by using the language template, and inserting the variable into the HTML codes;
step S273, generating a text file corresponding to the mail template according to the HTML code;
step S274, calculating the display positions of the specified content and the variables in the text file respectively to obtain the corresponding display layout;
and S275, calculating the specific display positions of the variables and the specified contents on the carrier according to the size information and the display layout, and converting the adjusted text file into a PDF function.
In practical application, in the parsing, specifically, by detecting the identification characters of the variables in the code, for example, the characters of email Address are detected in the code, the filling of the email Address is indicated, the characters of Message are detected, the filling of the specified email content is indicated, and the like.
After the variables are analyzed, the variables are specially marked, codes are compiled through a text conversion technology, and text files of mail templates are generated, namely the codes are converted into text expressions, so that mail contents wanted by business personnel are obtained.
In practical application, when converting, not only the translation of the code, but also the translation of the spacer are included, namely, the code characters are converted into characters, and the display positions of the converted characters are consistent with the display positions in the code.
And calculating the actual display layout of the mail text according to the size information of the carrier of the mail text of the display device, readjusting the translated mail template based on the display layout, specifically, adjusting by deleting characters or inserting characters, and finally converting the adjusted text file into PDF letters, thereby obtaining the mail template with a uniform display format.
In this embodiment, the above manner converts different mail templates, and presents the final displayed style in PDF, so as to realize unified output of multiple mail templates, facilitate user's calling and editing, and facilitate later maintenance.
In this embodiment, when the adjusted text file is converted into a PDF mail, the conversion is specifically performed by using an existing wkhtmltopdf conversion tool, which may be a picture conversion tool in addition to the wkhtmltopdf tool, where the mail template is converted into a picture.
In this embodiment, in the process of obtaining PDF mail by conversion, different adjustment modes are set for adapting to the mail transmission modes of different channels, where for online channels, due to the internet transmission adopted, the operation subject of the mail may be APP or a web page, but both APP and web page require a display carrier, and the adjustment for adapting to the mail template is performed according to the display carrier, where the adjustment includes:
selecting an application program for sending the mail according to the channel information;
and acquiring the display size of the mail editing interface of the application program and the display resolution of the terminal running the application program.
In practical application, the on-line channel is basically sent by adopting the APP, and in this case, in order to facilitate editing and display viewing of the mail, an adjustment template is required to be adjusted according to display parameters of display equipment of the APP, and in particular, calculation adjustment is performed according to the size and the display resolution of a display interface.
In this embodiment, the calculating, according to the size information and the display layout, a specific display position of the variable and the specified content on the carrier, and converting the adjusted text file into a PDF mail includes:
Calculating specific display positions of the variables and the specified contents on the terminal according to the display size, the display resolution and the display layout;
according to the specific display position, adjusting the display position of the variable and the specified content displayed in the text file in a mode of adding or deleting blank characters, wherein the blank characters comprise at least one of space characters and carriage return characters;
and converting the adjusted text file into the PDF mail through a preset HTML conversion PDF tool.
For example, for a text file translated by a mail template code to be a "respectful customer, your-! The xxx insurance you apply will expire on xxx day, if renewal is needed, please complete renewal as soon as possible, thank you for-! And when the character paragraph in which the space and the carriage return character are needed to be inserted is calculated according to the parameters of the application program, the specific adjustment is as follows:
"honored clients:
your good-!
The medical insurance you apply will expire on XXX, if renewal is needed, please complete renewal as soon as possible, thank you for-! ".
In this embodiment, if the mail is transmitted via an offline channel, the obtaining, according to the channel information, the size information of the carrier carrying the content of the mail template includes:
Selecting printing equipment for outputting the mail according to the channel information;
and acquiring the size and the printing direction of the printing paper of the printing output set in the printing equipment.
Further, the calculating, according to the size information and the display layout, a specific display position of the variable and the specified content on the carrier, and converting the adjusted text file into a PDF function includes:
calculating the number of words displayed by each row and the number of columns of the display of the variable and the specified content in the printing paper according to the size and the display layout;
according to the number of words displayed in each row and the number of columns displayed, carrying out layout adjustment on the variable and the specified content displayed in the text file according to the printing direction, wherein the adjustment is that blank characters are inserted or deleted, and the blank characters comprise at least one of blank characters and carriage return characters;
and converting the adjusted text file into the PDF mail through a preset HTML conversion PDF tool.
In practical application, since the printing device prints the file directly according to the received file in a manner of shrinking and enlarging, and does not perform adaptive layout adjustment and reprinting of the content in the file, in order to avoid this situation, in this embodiment, when outputting the printed mail template, parameters such as the size of the paper set on the printer and the printing direction are obtained first, according to these parameters, the layout display manner of the template content is calculated according to the font size specified in the template, and based on this layout display manner, the content display of the template is adjusted to implement the adaptation of the template content and the paper.
In order to avoid the difference of output, after the adjustment is completed, the adjusted text file is converted into an accessory with a fixed format, and finally the accessory is sent to the printing equipment for printing.
In this embodiment, after the PDF format file is output by the above method, the PDF format file may be directly stored in the storage unit, and after subsequent calls, the variable update operation may be directly performed on the PDF, for example:
email channel: and the template is assembled with corresponding mail data to generate PDF mail, and the updated PDF is sent as an accessory.
Jin Guangu channel: the client generates PDF mail by directly accessing the template through the gold manager APP mail inquiry interface and assembling the corresponding mail data, and can download the PDF file for self printing.
Mail office mailing paper mail channel: the mail platform sends the PDF to the post office through the logistics system, and then the post office directly prints the PDF into paper and sends the paper to the customer.
The assembly process comprises the following steps: the assembly program loads the data of the mail data table one by one, reads out the corresponding template and the corresponding data of the mail, assembles according to the one-to-one correspondence between the variables in the template and the variables in the data, and converts html into pdf mail through a wkhtmltopdf tool after finally generating an html file, thereby realizing unified management of the template, unified rule of the template, reducing the maintenance difficulty of the template and improving the service of the mail by aid of power-assisted business.
In summary, all mail service types are divided into two types of on-line and off-line, based on the two types, the size information of the corresponding carrier is acquired to adjust the mail template code, and finally the adjusted mail template is converted into a PDF format mail template, and the PDF format fixes the content display position in the mail template, so that the service personnel can not generate display difference when calling, and all mail templates are converted into a PDF format template, thus the service personnel do not need to maintain each template during maintenance, only the final PDF format file is required to be maintained, and the service personnel are convenient and visual when calling, and the use experience of the user is improved.
As shown in fig. 4, a flowchart of another mail generating method provided in the present application is taken as an example of sending a mail by a mobile phone, and specific description is made on the mail generating method, which includes the specific steps of:
step S410, detecting whether an APP of the mail on the mobile phone triggers the sending of the mail;
in this step, after detecting that the sending of the mail is triggered, determining the type of the mail to be sent, for example: confidential, plain or notification type mail.
Step S420, after triggering, acquiring a corresponding mail template according to the type of the triggered mail;
in this embodiment, the mail template is a template manufactured at a display ratio of 16:9;
step S430, obtaining display parameters of the mobile phone, and adjusting the content in the mail template based on the display parameters;
in this step, the adjustment refers to adjusting the format content written in the template according to the display parameters of the mobile phone, for example, when the display parameters are 9:16, the original content in the mail template can be displayed on a line, and when the mail template is adjusted to be displayed on the mobile phone, if the original display is adopted, the displayed font is very small, and as shown in fig. 5, fig. 5a is the original display format of the mail template, fig. 5b is the display format adjusted to be displayed on the mobile phone, and fig. 5c is the display format of the adjusted mobile phone.
Step S440, collecting mail content input by a user on a mobile phone, extracting the mail content, and automatically filling the mail content in a corresponding position in a mail template;
step S450, the mail template with mail content is converted into PDF file and then sent.
In this embodiment, the conversion of PDF refers to directly converting the mail text into PDF mail, and the conversion is displayed on the mail interface, where the user cannot edit the PDF mail.
In order to solve the above-mentioned problem, an embodiment of the present invention further provides a mail generating apparatus, as shown in fig. 6, including: a receiving module 61, a query module 62, a communication module 63, an acquisition module 64, a parsing module 65, a conversion module 66 and a mail generation module 67, wherein
A receiving module 61, configured to receive request information for sending a mail, where the request information carries type information for indicating the sent mail;
the query module 62 is configured to query, from a preset correspondence table, an identification identifier corresponding to the type information according to the type information, a correspondence between the type information and the identification identifier of the mail template; extracting mail templates corresponding to the type information from a preset template storage position according to the identification mark, and storing mail templates of at least one type of mail in the template storage position;
a communication module 63, configured to determine channel information to be used when sending the mail according to the request information, where the channel information includes an online channel and an offline channel;
the acquisition module 64 is configured to acquire size information of a carrier carrying contents of the mail template according to the channel information;
A parsing module 65, configured to extract a mail body specified in the request information, where the mail body includes recipient information and mail content;
the conversion module 66 is configured to perform visualization processing on the mail template to obtain a display file in HTML format, adjust a display format of the display file according to the size information, and convert the display file into a PDF format file, where the display format includes a display size of the display file and a display position of content therein;
and the mail generating module 67 is configured to update a variable in the PDF format file according to the mail body, and generate a mail file.
The execution function and the execution flow corresponding to the function based on the device are the same as the mail generation method embodiment of the present invention, so that the embodiment of the mail generation device is not described in detail.
In the embodiment of the present invention, the implementation of the mail generating device may be specifically implemented in a server, that is, the device implementing the mail generating method is set as a function in a server of a mail control platform, as shown in fig. 7, where the mail control platform includes a server 71 and a user terminal 72, and when a user of the user terminal 72 sends different types of mails, the user may uniformly send the mails by calling a third party mail service background set in the server 71 and send the mails through an internet interface in the server 51. It should be understood that the schematic structure shown in fig. 7 is merely a preferred structure provided by the embodiment of the present invention, and is not the only structure, and in other embodiments, the server 71 may implement the mail generating operation through other structures. Further, the mail generating device may be a mail editing function plug-in provided on the user side 72, and when in use, the mail editing function plug-in on the user side 72 performs conversion generation of the final mail by calling a mail template on the server 71, and finally the final mail is transmitted by the server 71.
In addition, the embodiment of the invention also provides a computer device, which comprises: the invention also relates to a method for generating mail, comprising the steps of storing the mail in a memory, a processor and computer readable instructions stored in the memory and executable on the processor, wherein the method implemented by the processor refers to various embodiments of the mail generating method of the invention, and therefore will not be described in detail.
The invention also provides a computer readable storage medium.
In this embodiment, the computer readable storage medium stores computer readable instructions, and a method implemented when the computer readable instructions are executed by one or more processors may refer to various embodiments of the mail generating method of the present invention, so that redundant descriptions are not repeated.
The method and the device provided by the embodiment of the invention are mainly characterized in that the identification mark of the corresponding mail template is inquired according to the type information of the sent mail, the corresponding mail template is called based on the identification mark, the channel information of the sent mail is obtained, the size information of the corresponding carrier is obtained according to the channel information to regulate the mail template, finally, the regulated mail template is converted into the mail template in the PDF format, the content display position in the mail template is fixed in the PDF format, so that the display difference can not occur when the service personnel call, all the mail templates are converted into the template in the PDF format, the personnel does not need to maintain the file in the final PDF format when maintaining, and the user is convenient and visual when calling, thereby improving the use experience of the user.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM), comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server or a network device, etc.) to perform the method according to the embodiments of the present invention.
While the embodiments of the present invention have been described above with reference to the drawings, the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many modifications may be made thereto by those of ordinary skill in the art without departing from the spirit of the present invention and the scope of the appended claims, which are to be accorded the full scope of the present invention as defined by the following description and drawings, or by any equivalent structures or equivalent flow changes, or by direct or indirect application to other relevant technical fields.
Claims (10)
1. The mail generation method is applied to a mail management and control system and is characterized by comprising the following steps of:
receiving request information for sending mails, wherein the request information carries type information for indicating the sent mails;
inquiring the identification corresponding to the type information from a preset corresponding relation table according to the type information and the corresponding relation between the type information and the identification of the mail template;
extracting mail templates corresponding to the type information from a preset template storage position according to the identification mark, and storing mail templates of at least one type of mail in the template storage position;
determining channel information to be used when sending the mail according to the request information, wherein the channel information comprises an online channel and an offline channel;
acquiring size information of a carrier bearing the content of the mail template according to the channel information;
extracting a mail text specified in the request information, wherein the mail text comprises recipient information and mail content;
the mail template is subjected to visualization processing to obtain a display file in an HTML format, the display format of the display file is adjusted according to the size information, and the display file is converted into a PDF format file, wherein the display format comprises the display size of the display file and the display position of the content in the display file;
And updating the variable in the PDF format file according to the mail text to generate a mail file.
2. The mail generation method as in claim 1, wherein said step of obtaining a display file in HTML format by visualizing said mail template includes:
analyzing the mail template to analyze variables and specified contents in the mail template;
obtaining a corresponding mail structured language template according to the variable and the specified content, converting the specified content into an HTML code by using the language template, and inserting the variable into the HTML code;
and generating a text file corresponding to the mail template according to the HTML code.
3. The mail generation method of claim 2, wherein said adjusting a display format of said display file according to said size information and converting to a PDF format file comprises:
calculating display positions of the specified content and the variable in the text file respectively to obtain corresponding display layout;
and calculating the specific display positions of the variables and the specified contents on the carrier according to the size information and the display layout, and converting the adjusted text file into a PDF function.
4. The mail generation method of claim 3, wherein the acquiring size information of a carrier carrying contents of the mail template based on the channel information comprises:
if the channel information is determined to be an online channel, selecting an application program for sending the mail according to the channel information;
and acquiring the display size of the mail editing interface of the application program and the display resolution of the terminal running the application program.
5. The mail generation method of claim 4, wherein said calculating a specific display position of said variable and said prescribed content on said carrier based on said size information and said display layout, converting said text file after adjustment into a PDF mail comprises:
calculating specific display positions of the variables and the specified contents on the terminal according to the display size, the display resolution and the display layout;
according to the specific display position, adjusting the display position of the variable and the specified content displayed in the text file in a mode of adding or deleting blank characters, wherein the blank characters comprise at least one of space characters and carriage return characters;
And converting the adjusted text file into the PDF mail through a preset HTML conversion PDF tool.
6. The mail generation method of claim 3, wherein the acquiring size information of a carrier carrying contents of the mail template based on the channel information comprises:
if the channel information is determined to be an off-line channel, selecting and outputting printing equipment of the mail according to the channel information;
and acquiring the size and the printing direction of the printing paper of the printing output set in the printing equipment.
7. The mail generation method of claim 6, wherein said calculating a specific display position of said variable and said prescribed content on said carrier based on said size information and said display layout, converting said text file after adjustment into a PDF mail comprises:
calculating the number of words displayed by each row and the number of columns of the display of the variable and the specified content in the printing paper according to the size and the display layout;
according to the number of words displayed in each row and the number of columns displayed, carrying out layout adjustment on the variable and the specified content displayed in the text file according to the printing direction, wherein the adjustment is that blank characters are inserted or deleted, and the blank characters comprise at least one of blank characters and carriage return characters;
And converting the adjusted text file into the PDF mail through a preset HTML conversion PDF tool.
8. A mail generating apparatus, characterized by comprising:
the receiving module is used for receiving request information for sending the mail, wherein the request information carries type information for indicating the sent mail;
the inquiring module is used for inquiring the identification corresponding to the type information from a preset corresponding relation table according to the corresponding relation among the type information, the type information and the identification of the mail template; extracting mail templates corresponding to the type information from a preset template storage position according to the identification mark, and storing mail templates of at least one type of mail in the template storage position;
the communication module is used for determining channel information to be used when the mail is sent according to the request information, wherein the channel information comprises an online channel and an offline channel;
the acquisition module is used for acquiring the size information of the carrier bearing the content of the mail template according to the channel information;
the analysis module is used for extracting a mail text specified in the request information, wherein the mail text comprises recipient information and mail content;
The conversion module is used for obtaining a display file in an HTML format through visual processing of the mail template, adjusting the display format of the display file according to the size information, and converting the display file into a PDF format file, wherein the display format comprises the display size of the display file and the display position of the content in the display file;
and the mail generating module is used for updating the variable in the PDF format file according to the mail text to generate a mail file.
9. A computer device, the computer device comprising: memory, a processor, and computer readable instructions stored on the memory and executable on the processor, which when executed by the processor, implement the steps of the mail generation method of any of claims 1-7.
10. A computer-readable storage medium having stored thereon computer-readable instructions which, when executed by one or more processors, implement the steps of the mail generation method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010182261.5A CN111464425B (en) | 2020-03-16 | 2020-03-16 | Mail generation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010182261.5A CN111464425B (en) | 2020-03-16 | 2020-03-16 | Mail generation method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111464425A CN111464425A (en) | 2020-07-28 |
CN111464425B true CN111464425B (en) | 2023-07-28 |
Family
ID=71680742
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010182261.5A Active CN111464425B (en) | 2020-03-16 | 2020-03-16 | Mail generation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111464425B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112104544B (en) * | 2020-09-08 | 2022-05-10 | 紫光云(南京)数字技术有限公司 | Method and device for sending dynamic mail based on Freemarker |
CN113824850A (en) * | 2021-04-06 | 2021-12-21 | 京东科技控股股份有限公司 | Letter transmission method and device, electronic equipment and storage medium |
CN115629768B (en) * | 2022-12-21 | 2023-03-10 | 西安葡萄城软件有限公司 | E-mail template analysis method based on Excel formula engine |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110474836A (en) * | 2019-08-16 | 2019-11-19 | 深圳乐信软件技术有限公司 | A kind of email template generation method, calculates equipment and medium at device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8819541B2 (en) * | 2009-02-13 | 2014-08-26 | Language Technologies, Inc. | System and method for converting the digital typesetting documents used in publishing to a device-specfic format for electronic publishing |
US20150339285A1 (en) * | 2014-04-22 | 2015-11-26 | Aman Safaei | Methods and Systems for Batch Generation and Delivery of Customized Documents |
-
2020
- 2020-03-16 CN CN202010182261.5A patent/CN111464425B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110474836A (en) * | 2019-08-16 | 2019-11-19 | 深圳乐信软件技术有限公司 | A kind of email template generation method, calculates equipment and medium at device |
Also Published As
Publication number | Publication date |
---|---|
CN111464425A (en) | 2020-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111464425B (en) | Mail generation method, device, equipment and storage medium | |
CN106933862B (en) | Method and device for generating mail report | |
US8166117B2 (en) | Converting a text-based email message to an email message including image-based fonts | |
CN107092625B (en) | Data configuration method, data processing method and device | |
CN110865775B (en) | Printing method for online design and preview based on WEB | |
US7904807B2 (en) | System and method for copying formatting information between Web pages | |
US20130110769A1 (en) | Service providing apparatus, information processing system and methods | |
US20020073034A1 (en) | Method and system for operating online classified advertisements | |
CN113342450B (en) | Page processing method, device, electronic equipment and computer readable medium | |
CN101075989B (en) | Method and system for verifying field validity | |
US20020029250A1 (en) | Method and apparatus for transmitting an electronic message on electronic letterhead | |
CN110474836A (en) | A kind of email template generation method, calculates equipment and medium at device | |
JP2012256347A (en) | Method for operating file with mobile terminal, system, computer program, and computer-readable recording medium | |
CN117291151A (en) | Method, device, computer readable medium and equipment for controlling conversion of document format | |
CN101001212B (en) | Multi-system message interaction management and control system and method | |
US12265499B2 (en) | Method for migrating a customer communication document between customer communication management platforms | |
CN101841514A (en) | Mail handing method and device | |
US20130339405A1 (en) | Information processing system, information processing apparatus, control method therefor and computer-readable storage medium | |
JP3923850B2 (en) | Electronic document creation system | |
CN113743060B (en) | Customizable report generation method, device, computer equipment and storage medium | |
CN113822025A (en) | Office file automatic generation method, device, equipment and storage medium | |
JP2002049564A (en) | Reply e-mail creation device, creation method, and recording medium | |
CN113553812A (en) | News processing method and device combining RPA and AI | |
JP3913888B2 (en) | Document creation system, WWW (World WideWeb) server, and recording medium | |
JP2003242127A (en) | Business integrated system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |