Mail merge is a software operation describing the production of multiple (and potentially large numbers of) documents from a single template form and a structured data source. The letter may be sent out to many "recipients" with small changes, such as a change of address or a change in the greeting line. Both WordStar (via an ancillary program) and WordPerfect offered this capacity for CP/M and MS-DOS systems. Microsoft Word Mail Merge allows a user to send letters or documents to many people simultaneously; users simply create one document that contains the information that will be the same in each version, and then add placeholders for the information that will be unique to each version.
Now used generically, the term "mail merge" is a process to create personalized letters and pre-addressed envelopes or mailing labels mass mailings from a form letter – a word processing document which contains fixed text, which will be the same in each output document, and variables, which act as placeholders that are replaced by text from the data source.
The data source is typically a spreadsheet or a database which has a field or column for each variable in the template. When the mail merge is run, the word processing system creates an output document for each row in the database, using the fixed text exactly as it appears in the template, but substituting the data variables in the template with the values from the matching columns.
Mail merging is done in following simple steps:
- Creating a Main document.
- Creating a Data Source.
- Adding the merge fields into main document.
- Merging the data with the main document.
A common usage is for creating "personalised" letters, where a template is created, with a field for "Given Name", for example. The templated letter says "Dear <Given Name>", and when executed, the mail merge creates a letter for each record in the database, so it appears the letter is more personal. It is often used for Variable Data Printing.
Another common usage is for creating address labels from a Customer Relationship Management database, or for mass emails with pertinent information in them, perhaps a username and password.