IEmailTemplateSource plugin

The IEmailTemplateSource plugin template enables PolicyCenter to retrieve one or more email templates. To see the plugin registry, navigate in the following location in the Studio Project window:

  • configuration > config > Plugins > registry > IEmailTemplateSource.gwp

In the base configuration, Guidewire provides the following demonstration plugin implementation, registered in IEmailTemplateSource.gwp:

  • gw.plugin.email.impl.LocalEmailTemplateSource

The LocalEmailTemplateSource class constructs an email template from files located in the Studio resources folder:

  • configuration > config > resources > emailtemplates

Method getEmailTemplates on the implementation class searches for an email template.

  • getEmailTemplates(locale : ILocale, valuesToMatch : Map) : IEmailTemplateDescriptor[]

This method accepts the following arguments.

Parameter

Description

locale

Locale to search for. The argument can be null.

If locale is not null, the search is performed in the resource > emailtemplates folder for a subdirectory whose name matches the specified locale value. A match is tested in the following order.

  • Language + Country + Variant
  • Language + Country
  • Language
  • Default language as specified in the config.xml configuration parameter DefaultApplicationLanguage.

valuesToMatch

Keys to match include topic, name, keywords, and availablesymbols. The availablesymbols key is matched against the template's requiredsymbols.

The method returns an array of zero or more IEmailTemplateDescriptor objects that match the locale and specified values to match. If no matches are found, the returned array is empty.