Create a pipeline processor to convert form data in a custom personalization token
You can set up EXM to initiate an automated email campaign once the customer has completed and submitted a form from a site. However, you might want to transform the original form field value to a different format for use as a custom personalization token in the rendered email message.
In the following example, the pipeline processor transforms the value of a check box list field and renders it as a list of comma-separated values. You can use the same logic for any type of form control.
To implement a new pipeline processor:
-
Implement a
TransformCheckboxListprocessor that checks for theCheckBoxListViewModelfield and transforms the original value of the field from aList<string>to a comma-separated string and sets theTransformedTokenValueproperty value: -
Patch the Sitecore configuration to include the processor implemented in the
transformFormsCustomTokenpipeline: