1. Home
  2. Knowledge Base
  3. Marketing
  4. Marketing: Standard Letter Text Maintenance

Marketing: Standard Letter Text Maintenance

Standard Letter Text Maintenance

Standard Letter Text Maintenance

This window is used to maintain standard letter texts. It is accessible by operating the Letter Maintenance function from the Marketing Menu.

These letters can be sent individually to the currently selected business and selected contact using the Letter Letter toolbar tool. They can also be sent to businesses selected in the Marketing Listing window. Select lines on the list and then operate the Print Selected Letters function from the Marketing List Options Menu.

There is a single standard report class that provides a basic letter layout. This class in OpenVision is called rMarketLetter and is used unless the letter is given a custom report class you have created. You can also add multiple designs which you will have to select from for those letter designs not given a specific report class. To do this addLETTER type custom report classes in to your Settings Maintenance window.

While Standard Letters are maintained within the Marketing task, they can be used wherever an address is available:

  • Using the Print Standard Letter function from the context menu (right-click) of an address displayed on a window (e.g. Customers, Suppliers, Sales Orders, Serial Numbers)
  • Masters — Customers — Print Reports
  • Masters — Suppliers — Print Reports
  • Process — Product Serial Numbering — Print Reports
  • Process — Product Serial Numbering — Print Tracking Reports

If you are using the Language Swap System you may have language translations for letters. When this window opens your base language and all swap languages and shown as tabs. Marketing, Customers and Suppliers can have specific languages set and as this window applies when you are printing a letter to many contacts, all language variants of the letter can be accessed, modified and checked.



Group and Letter List

Tree list of all letters stored in the system. Letters belong to groups for convenience of filing.


Letter Texts for Contacts. Letter text name. {LETFILE.LETNAME char 40}


Letter Texts for Contacts. Re: text for the letter. {LETFILE.LETREF char 60}


Letter Texts for Contacts. Letter text. {LETFILE.LETTEXT char 10000000}

Report class

Letter Texts for Contacts. Report class to be used for this letter (blank is default). {LETFILE.LETCLAS char 60}

Class description

The description of the report class, if any.




To export the selected letter to a text file. Others can then import the letter.


To import a letter from a text file which has been exported from another data file.

Add New

This will create a new standard letter. If you have selected nothing or a Group line in the tree list, you will be offered a dialogue to enter a new group title. An unused title will automatically create a new group.


Execute this button to permanently remove the currently selected record from the file. If you are permitted to delete the item, you will be asked for confirmation, otherwise an explanation will be given.


Cancel any changes you have made and revert to that saved on file.

Save Changes

Save any changes you have made to file.

Complex Data Embedding

You can embed square bracket notation into the text and reference of a standard letter. Anything inside square-brackets is evaluated as a calculation before the text is printed. Such calculations can contain data from the DEAFILE, ADRFILE and ADCFILE and CUSFILE and SUPFILE where linked in a marketing record and when they are associated with an address.

$ctask.tCustom1.$MyFunction(params,…) syntax can be used but should not affect the relevant master files.

Additional data can be embedded using custom letter report and methods – see below Sending to Email second Custom Capability.

The text of the letter can contain limited enhancement tags, as in HTML. These are limited to <B>Bold</B>, <I>Italic</I> and <U>Underline</U> syntax.


There is a function that can be used in custom reports for removing text enhancements where they would be inappropriate (for HTML or Email report destinations, for example):

$ctask.tPrint.$StripFormatting( pFormattedText )

It returns the text with any style escape strings removed.

Sending to Email

If your report destination is Email, individual personalised emails are sent (see Bulk Email Sending Details for details). This is an exceptional behaviour of the Email system as the letter report is not created as an HTML document and attached to an email. Each business is sent the letter as email body text.

You can directly send marketing letters as personalised emails. If Email is selected as the report destination, printing a marketing letter, or a letter to a selection of companies on the list, will format the letter into the body text of an email and send it after confirmation. Contacts encountered without a valid email address (contain an @ symbol) will be skipped. The letter Reference is used as the Email heading, and if there is no ADCDEAR contained in the letter text, a Dear [ADCDEAR] will be appended. The normal email signature of the user will be applied. This feature can be used to send individual emails to a group of marketing contacts. Care should be taken to respect Netiquette rules about unsolicited spam (internet junk mail).

Customisation CUSTOM CAPABILITY: The normal mechanism for Email Letters is to place the the text into the body of the email. However, if the report class contains an $IsAttatchment class method that returns true, in addition to the normal behaviour, the report will be printed as an attachment (either PDF or HTML). If the report class has a $FileName class method it’s returned text will be used as the file name, otherwise the class name is used as the attached file name. This allows you to, for example, create a Newsletter that will be attached to the letter email and can be personalised with customer, supplier and marketing (or other records associated with the address) data elements and calculations. An example is built-in which has the class name rMarketPDFLetter.

Customisation CUSTOM CAPABILITY: If you want to embed data from elswhere, such as custom tables, or even from list of data related to the master data in DEAFILE, ADRFILE and ADCFILE and CUSFILE and SUPFILE tables, you can do this with a custom copy of rMarketLetter. Add a class method to this report named $EmailTexts This method should contains a commented $ctask method sub-path, e.g. ; tCustom1.$_CaliachEmailTexts Your custom oCustom1 method $_CaliachEmailTexts is then run with Field reference parameters Master Data Row, Letter Referring To text, Letter text. That method must contain suitable embedding code that substitutes for the normal […] syntax, perhaps {…} (using braces). An example is:

Do $ctask.tSqlData.$DefineTableFind(l_CalRow, 'tlCalLicenseUsers', row(pRow.DEAID), 'CluCusDeaid=@[iRow.C1]', 'ORDER BY CluLicenseNo DESC LIMIT 1') Returns #F
If flag true
   	Do $cinst.$_CaliachMergeText(pLetterRef, l_CalRow)
   	Do $cinst.$_CaliachMergeText(pLetterText, l_CalRow)
End If

The first Do defines the row l_CalRow from the custom table class tlCalLicenseUsers and loads it with a select on the database where CluCusDeaid=pRow.DEAID. In other words, a row from CalLicenseUsers related to the marketing row. The oCustom1.$_CaliachMergeText method is then used to embed the data in l_CalRow into the Reference to and then the letter Texts. The Standard Letter text could then be as follows (note the use of different syntaxes […] for master data and {…} for our custom data):

Att: [pRow.ADCSALU] [pRow.ADCFIRS] [pRow.ADCLAST] - [pRow.ADCJOB]

Dear [pRow.ADCDEAR],

Site License No = {pRow.CluLicenseNo}
Current Annual Support Fee = GBP {pRow.CluSupportFee}

Tip TIP: Sometimes it may be useful to have standard attachments which will always be enclosed regardless of the report being emailed. To do this copy the attachment files to the EmailFixed directory.

Embedding a Graphic Signature

You can embed a scanned signature into a Letter. To do this you need to have external JPEG files in the Datafile folder in a folder named Graphics and set the letter’s report class to rMarketLetterSig. If you don’t have the letter structured correctly or have access to the correctly named signature JPEG graphic file, the letter will print as normal, with no graphic.

The letter needs to have the following:

  • Have exactly 5 carriage-return characters followed by a character greater than or equal to A.
  • The alpha character is the start of the signatories name.
  • The name must end with a carriage-return character.
  • The signature graphic file must be named with the name above followed by .jpg and be readable by the user.

For example the letter could be:

Body letter text….. with 5 returns followed by the Name and another return
James Ferrier
Sales Director
P.S. Some terminating text….

The signature graphic should then be GraphicsJames Ferrier.jpg. It must be JPEG format with an optimal size of 8cm wide by 1.7cm high. Note that with Language Swap multi-ligual letters may need multiple signature graphic files if the name is different.

To help you debug this when you print the letter leave open the Standard Letter Text Maintenance window. If the graphic is not printed you will see a message at the end of the print explaining why.

See also: –

Compiled in Program Version 5.10. Help data last modified 12 Jul 2018 06:20:35.17. Class wMarketLetterMaint last modified 23 Sep 2017 10:50:57.

Was this article helpful?

Related Articles

Get started.

Try our state-of-the-art ERP Manufacturing Software today.