Related Information Examples & Tutorials

How To Add A Subject When Printing To Email

This topic explains how to edit your letters and reports to include an appropriate Subject Line when printing to EMAIL.

By default, whenever you print to EMAIL in Collect!, the name of the report or letter you are printing is used as the email Subject. Using the @SUBJECT report writer command, you can customize and personalize the Subject line as needed. This makes it very easy for your email recipients to identify your important emails with a glance at their email Inbox.

@SUBJECT

The @SUBJECT line is placed at the top of the report body. Collect! composes the email and adds the Subject you have specified.

tip.gif The @SUBJECT command is specific to printing to email only. It is case sensitive. You have to use quotes around the data to be printed. It does not support quotes inside the quotes.

SYNTAX: @SUBJECT "This is my Email Subject"

Placing this line at the top of your report will output "This is my Email Subject" in the email's Subject box, when the email is sent.

USING FIELD CODES WITH @SUBJECT

1. You can include printable field codes in the @SUBJECT
line along with text. When the email is printed, Collect! will insert the information from the database.

SYNTAX: @SUBJECT "This is my Email Subject for File:@de.fi"

Placing this line at the top of your report will output "This is my Email Subject for File:1423" in the email's Subject box, for File number 1423.

2. You can use multiple field codes and text combined.

SYNTAX: @SUBJECT " Debtor: @de.co File: @de.fi"

This will output the "Debtor: Joe Smith File: 1443" as the email Subject for Debtor, Joe Smith with File number, 1443.

3. You can also use only printable information codes and no additional text as shown below.

SYNTAX: @SUBJECT "@de.co @de.fi @de.su"

Placing this line at the top of your report will output "Joe Smith 1443 Summary text" in the email's Subject box for Debtor, Joe Smith.

USING VARIABLES WITH @SUBJECT

1. You can use variables in the @SUBJECT line, as well
as field codes and text.

SYNTAX:
@varFile# = @de.fi
@SUBJECT "This is my Email Subject for File:@varFile"

Placing these lines at the top of your report will output "This is my Email Subject for File:1423" in the email's Subject box, for File number 1423.

2. You can use an IF clause to change th value of the variable before assigning it to the @SUBJECT line.

SYNTAX:
@varDate! = @d
@varDate = @de.li if( @de.li < 01/01/2012 )
@SUBJECT "This is my Email Subject @varDate"

Placing these lines at the top of your report will output "This is my Email Subject 07/31/2012" in the email's Subject box, if the Debtor's Listed Date is 01/01/2012 or newer.

3. You can use variables as well as text and field codes to create a unique Subject line.

SYNTAX:
@varDate! = @d
@varDate = @de.li if( @de.li < 01/01/2012 )
@SUBJECT "This is my Email Subject for @de.fi @varDate"

Placing these lines at the top of your report will output "This is my Email Subject for 1423 07/31/2012" in the email's Subject box, if the Debtor's Listed Date is 01/01/2012 or newer and the File Number is 1423.

USING @SUBJECT SUCCESSFULLY

@SUBJECT is case sensitive.

Always use quotes around the Subject string.

Do not use field formatting codes such as @de.na<12>. Collect! will not process any field code with formatting characters attached to it.

tip.gif Instead, you can assign a formatted field to a variable, and the use the variable in the @SUBJECT command.

Do not attempt to grab your Subject from data in a loop. Collect! composes the email after processing the entire report. So you should not use @SUBJECT with field codes in a report that has a loop in it or you may get wrong results. For instance, if you have a debtor loop in your report and you are trying to print @de.fi in the Subject, you will get the File Number for the last debtor in the loop. This may not be what you intended.

tip.gif You can however, grab your data and store it in a variable and assign that to the @SUBJECT command.

Batch Printing Email

Collect! is able to process the @SUBJECT command when printing batches to email. If the email prints correctly from the Debtor or Client, it will also print correctly when printed in your batch.

Top of page.

Summary

The @SUBJECT command is a very handy report writer function for printing to EMAIL. It enables you to personalize the email Subject, inserting a line of text or data taken from the record whose data you are printing. Following the simple guidelines shown in this topic will ensure your success when using @SUBJECT in your reports and letters printed to EMAIL from a single account or in your letter batches.

Top of page.

See Also

- How To Send Email in Collect!
- Report Topics Index

Top of page.

Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.

Please click this link to send us your comments: helpinfo@collect.org