Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-1504

Mailing Labels - Allow Formatting of Name Line for Labels


    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0
    • Fix Version/s: 1.7, 2.0
    • Component/s: Core CiviCRM
    • Labels:


      Users want the ability to configure the name portion of mailing address labels. In addition, users may want to format the Contact Summary Address display differently from the format used in Mailing Labels. The current "Address Format" setting is used for both contact/view display AND for Mailing Labels. Hence, we need to create a new separate configuration setting for "Mailing Label Format" and a new setting for specifying the elements to output for Individuals' Contact Names when used in a mailing label.

      1. Create new configuration setting for "Individual Name Format". This setting should allow users to include any of the following tokens to define the elements in their mailing label contact name line WHEN the contact type is Individual:

      {display_name}, {individual_prefix}, {individual_suffix}, {first_name}, {middle_name}, {last_name}, {custom_1 thru 'n'}

      Default string for this config field is:
      {individual_prefix}{ } {first_name}{ }{middle_name}{ }{last_name}{ }{individual_suffix},

      When evaluating this set of tokens, strip any leading or trailing spaces if specific elements are null for a given contact record. Examples:
      "Mr. David Greg Greenberg", "Dan Green Jr.", etc.

      2. Create a new configuration setting for "Mailing Label Format". This setting supports the same location-related tokens as the existing ADDRESS_FORMAT setting. In addition, it supports a new token - {contact_name}.

      When mailing labels are generated, the {contact_name} token is evaluated as follows:
      - If contact type = Individual, create a string using the token(s) specified in the new "Individual Name Format" config setting above.
      - Else, replace with {display_name}

      and evaluate (for Households and Organizations).

      Also, if a value for a given line is empty, that line is skipped (i.e. no blank lines). Also, if the "name" line is not defined, then the label begins with street_address (we don't force users to include name field(s) in the label).

      Default value for this setting is:

      {contact_name} {street_address} {supplemental_address_1} {supplemental_address_2} {city} {, } {state_province}

      { }

      {postal_code} {country}

      3. Create a new fieldset - (legend=Mailing Labels) - in the Admin/Setting/Address.php form with these two new config fields for editing the above settings.

      "Individual Name Format" , html type = text, class = huge
      "Mailing Label Format" , html type = textarea, class = huge




            • Assignee:
              shailesh Shailesh Lende
              speleo Henry Bennett
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: