BounceStudio Variables



A BounceStudio Variable is a data value that can be used anywhere in your SQL statements or Web Urls. For SQL statements, they are most commonly used in the VALUES clause of an INSERT statement, the SET clause of an UPDATE statement, or as parameter values for a SQL stored procedure. The value contained in each variable is relevant to the message that BounceStudio is currently processing.

You can use a variable by typing it into the SQL Statement textbox or Web Url textbox using surrounding pound symbols "##". For example, to refer to the variable "EMAIL", you would type "#EMAIL#".

NOTE: Variables are case-sensitive. Also, all BounceStudio Variables used in your SQL Statements will be SQL Encoded, thus escaping any common control characters (ie. apostrophes/single quotes). The BounceStudio Variables you use in your Http Push Web Urls will be URL encoded.


Standard BounceStudio Variables

The table below lists the standard BounceStudio variables that BounceStudio Enterprise can use. These variables work by default and do not need to be enabled by you.


NameDescription
#BOUNCETYPE#The bounce 'type' of the bounced message. (ie. SB, HB, GB)
#EMAIL#The original recipient email address of the bounced message.
#MONITOREDITEM#The Monitored Item that BounceStudio retrieved/read the bounced message from.
#RAWMESSAGE#The raw text of the email message BounceStudio retrieved.



Advanced BounceStudio Variables

The table below lists the advanced BounceStudio variables that BounceStudio Enterprise can use. Except for the #VERPEMAIL# variable, these variables need to be enabled by you on the Global Settings - General screen in BounceStudio Admin.


NameDescription
#XBPS1#The X-BPS1: email header value of the original outbound email message. (See Below)
#XBPS2#The X-BPS2: email header value of the original outbound email message. (See Below)
#CUSTOM1#A user defined email header value of the original outbound email message. (See Below)
#CUSTOM2#A user defined email header value of the message BounceStudio retrieved. (See Below)
#TO#The TO: email header value of the message BounceStudio retrieved.
#FROM#The FROM: email header value of the message BounceStudio retrieved.
#SUBJECT#The SUBJECT: email header value of the message BounceStudio retrieved.
#BODY#The BODY of the message BounceStudio retrieved.
#VERPEMAIL#The VERP email address encoded into your outbound email messages.



Deprecated BounceStudio Variables

The table below lists BounceStudio variables that are no longer used. They have been replaced, or not needed anymore. These variables will remain active for some time, to promote backward compatibility with your old BounceStudio SQL statements and Http Push web urls. It's highly recommended you make the necessary updates though. They do not support the truncation functionality, as described below.


NameDescription
#X-BPS1#(Deprecated. Has been replaced by #XBPS1#.) The X-BPS1: email header value of the original outbound email message.
#X-BPS2#(Deprecated. Has been replaced by #XBPS2#.) The X-BPS2: email header value of the original outbound email message.
#RAWMESSAGETRUNCATED#(Deprecated. Use #RAWMESSAGE# variable, with a "truncate" value.) The first 4000 characters of raw text of the email message BounceStudio retrieved.



Truncating BounceStudio Variables

BounceStudio Variables allow you to truncate the data contained within them. For instance, you may want to save only the first 1000 characters of the message body, the #BODY# BounceStudio Variable, to your database. To do this, you'd enter #BODY-1000# instead of #BODY# within your SQL statement. The format for truncating BounceStudio Variables looks like this:


#{BounceStudio Variable Name}-{Truncate Value}#



The truncate value can be any integer value between 1 and 2,147,483,647, and cannot include commas or decimal points. Here are some examples of using the truncate functionality.


ExampleDescription
#RAWMESSAGE-1000#Returns the first 1000 characters of the #RAWMESSAGE# BounceStudio Variable.
#RAWMESSAGE-2000#Returns the first 2000 characters of the #RAWMESSAGE# BounceStudio Variable.
#CUSTOM1-10#Returns the first 10 characters of the #CUSTOM1# BounceStudio Variable.
#BODY-500#Returns the first 500 characters of the #BODY# BounceStudio Variable.



Custom Header Information

#CUSTOM1# - This variable is designed to retrieve an email header value from the headers of the original messages you send. For instance, if you enabled the #CUSTOM1# BounceStudio Variable and set it's value to "X-CampaignId" on the Global Settings - General screen, then BounceStudio would set the #CUSTOM1# variable value to 12345 if you created your outbound message with email headers similar to the sample below.


	To: "Joe User" <joe@hisdomain.com>
	From: "Sales Team" <you@yourcompany.com>
	X-CampaignId: 12345
	Subject: Hey!  Check out this offer...
	
#CUSTOM2# - This variable is designed to retrieve an email header value from the headers of the actual bounced messages. For instance, if you enabled the #CUSTOM2# BounceStudio Variable and set it's value to "Date" on the Global Settings - General screen, then BounceStudio would set the #CUSTOM2# variable value to the standard Date header value of the message.

NOTE: You can search for any header you want, you're not limited to the sample header names used above. You can retrieve whatever you want, for instance, Message-ID, Thread-Index, Return-Path, etc.


Special X-Header Information

BounceStudio Enterprise also gives you the ability to parse specific x-header information that you include in your outbound email message headers. Specifically, BounceStudio Enterprise has the ability to parse two special BounceStudio Enterprise email x-headers called #X-BPS1# and #X-BPS2# (See table above). Here is a sample email header of an outbound message:

	To: "Joe User" <joe@hisdomain.com>
	From: "Sales Team" <you@yourcompany.com>
	X-BPS1: 12345
	X-BPS2: 678
	Subject: Hey!  Check out this offer...
	
If you enabled the #XBPS1# and the #XBPS2# BounceStudio Variables on the Global Settings - General screen, then BounceStudio would set the #XBPS1# variable value to 12345 and the #XBPS2# variable value to 678 if it encountered the email headers above.


Samples

Sample Database SQL Statement
INSERT INTO bBounceLog (sAccountName, sEmailAddress, sBounceType)
VALUES ('#MONITOREDITEM#', '#EMAIL#', '#BOUNCETYPE#')


Sample Http Push Web Url
http://abc.com/log-it.asp?emailAddress=#EMAIL#&bounceType=#BOUNCETYPE#&accountName=#MONITOREDITEM#