Communication Context Variables


Overview

Communication context variables allow for dynamic content to be presented within a communication.  For example, a context variable may be used to insert a <Document Requirement Name> into the body of a 'Missing Information' communication email. This page provides the context variables available for use within a communication template. 

Template Content

Template content is comprised of two types of scripting languages:

  • HTML/CSS markup - communication structure, graphics, static text
  • Velocity Template Language (VTL) scripting which provides for the dynamic content - merging in Student, Document, Award data, etc.

The Velocity Templating Engine Syntax is described here: http://velocity.apache.org/engine/devel/vtl-reference-guide.html

CSS code for layout can be used but it must be placed in the <head> element of the HTML document.

Regent Data Model Access

VTL allows one to reference certain context variables that allow access to the Regent Award data model. The data model entities are .NET objects and should be interfaced with using the proper syntax and interface methods as defined by the .NET framework. Please see msdn.microsoft.com for further information.


Context Load Settings mapping

 Context Load Settings

Load Academic Plan Data - $AcademicPlan
Load EST Record Disbursements Data - $ESTRecordDisbursements
Load Documents Context Data - $Documents
Load R2T4 Context Data - $R2T4s
Load R2T4 PWD Context Data - $R2T4PWDs
Load Last Payment Period Name - $Student.LastPaymentPeriod (<String>)
Load Last Enrollment End Date - $Student.AnticipatedProgramEndDate (DateTime)
Load Address Data - $Student.AddressList (List<StudentAddress>)
Load Phone Number Data - $Student.PhoneList (List<StudentPhone>)
Load Email Address Data - $Student.EmailList (List<StudentEmail>)
Load Student Financial History - $StudentFinancialHistory; $StudentSubsidizedUsageHistory
Load College Financing Plan Data - $CFPContext
Load Parent/Spouse/Reference Data - $Student.ParentSpouseList (List<StudentParentSpouse>)
Load Portal Data - $Student.PortalData (StudentPortalData())
Load Student Information System Record Data - $Student.SISRecord (SISRecord())
Load Student Additional Information Data - $Student.AddtInfoList (List<StudentAdditionalInfo>)
Load ISIR Data - $Student.ISIRRecords (List<StudentDataIsirRecord>)
Load Complete ISIR Data - $Student.ISIRRecords (List<StudentDataIsirRecord>)
Load Student SAP Context - $StudentSAPList
Load Student Communication History - $StudentCommunicationHistoryList
Load Communication Parameter Data - $CommunicationParameters
Load Course Data For Active Program - $CourseData
Load Institution Portal Settings - $InstitutionPortalSettings
Load Program Data - $Program


At the current time, Data Models in the spreadsheet attached below are accessible to the Communications engine. 

Communication Context Variables (8/12/2024 6.8.0.0 Release

VelocityTools


There is a utility context variable surfaced in all communication templates accessed with the $tools reference. The following methods are provided by the VelocityTools utility:

  • AbsoluteValue(decimal amount) – returns absolute value of amount
  • GetCurrentDateTime() – returns System.DateTime.Now object
  • Format(string format, params object[] args) – returns string.Format(format,args)
  • The following AntiXSS** methods are also provided:
    • HtmlEncode(string value) - returns AntiXSS.HtmlEncode(value)
    • HtmlEncode(string value, bool useNamedEntities) - returns AntiXSS.HtmlEncode(value, useNamedEntities)
    • HtmlAttributeEncode(string value) - returns AntiXSS.HtmlAttributeEncode(value)
    • HtmlFormUrlEncode(string value) - returns AntiXSS.HtmlFormUrlEncode(value)
    • HtmlFormUrlEncode(string value, int codePage) - returns AntiXSS.HtmlFormUrlEncode(value, codePage)
    • HtmlFormUrlEncode(string value, System.Text.Encoding encoding) - returns AntiXSS.HtmlFormUrlEncode(value, encoding)
    • JavascriptEncode(string value) - returns AntiXSS.JavaScriptEncode(value)
    • JavascriptEncode(string value, bool emitQuotes) - returns AntiXSS.JavaScriptEncode(value, emitQuotes)
    • CssEncode(string value) - returns AntiXSS.CssEncode(value)
    • UrlEncode(string value) - returns AntiXSS.UrlEncode(value)
    • UrlEncode(string value, int codePage) - returns AntiXSS.UrlEncode(value, codePage)
    • UrlEncode(string value, System.Text.Encoding encoding) - returns AntiXSS.UrlEncode(value, encoding)
    • XmlEncode(string value) - returns AntiXSS.XmlEncode(value)
    • XmlAttributeEncode(string value) - returns AntiXSS.XmlAttributeEncode(value)
    • DateTime StringToDateTime(string value) - returns DateTime.Parse(value)
    • StringToFloat(string value) - returns float.Parse(value)
    •  NearlyEqual(float f1, float f2, float eps)

      //uses the smaller of the two values and multiples it by epsilon to determine the margin of error.

      // Equal if difference is within the epsilon precision value (i.e. 0.00001, 0.0000001, 0.1)

      var a = Math.Abs(f1);
      var b = Math.Abs(f2);
      return Math.Abs(a - b) <= (a < b ? b : a) * eps;
    •  IsGreaterThan(float a, float b, float eps)
      return (a - b) > ((Math.Abs(a) < Math.Abs(b) ? Math.Abs(b) : Math.Abs(a)) * eps);
    •  IsLessThan(float a, float b, float eps)
      return (b - a) > ((Math.Abs(a) < Math.Abs(b) ? Math.Abs(b) : Math.Abs(a)) * eps);

**AntiXSS – is of class Microsoft.Security.Application.Encoder – the Microsoft Anti-Cross Site Scripting Library

Previewing Templates

You can perform a 'test run' or 'preview' of a communication template using the Preview With Student feature found at the bottom of the Content Editor Text Box. This feature is only available to use when one is in edit mode. In order to preview the template, enter a Student External ID and select the Preview With Student button.