Eliminate blank lines for empty tokens

The problem

Often, when using tokens in addresses, you may end up with irritating blank lines.

For example, if you put the following tokens in a PDF letter or mailing labels:

{contact.street_address}
{contact.supplemental_address_1}
{contact.city}, {contact.state} {cotnact.postal_code}

If the person doesn't have a supplemental address, it might print like this:

123 4th Avenue

Lincoln, NE 68502

The solution

The reason you get these blank lines is because of the HTML formatting that is added to your message or PDF template.

You can't see the formatting by default - however, if you click the "Source" button from the editor menu bar, you will see your template or PDF letter as HTML source code. It's daunting! But you may see something like this (with BR tags):

Tokens with BR tags

Or you might see something like this (with P tags):

Tokens with P tags

In HTML language, the br and p tags cause the line breaks to happen. And the problem is that they will cause a line break whether or not the token is filled in.

If you change the HTML code to the following, you will not have that problem:

Tokens with div tag

The "div" tag will also cause line break - but only if there is content.

Category: 
Email and Postal Mailings