IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
This article demonstrates way how to programmatically create a custom field for email subscribers. You can use this field as a custom field in the email campaign - for example, for title or country.
NOTE: By default, this field can not be accessed in the backend. If needed, you can create your own Overview: Types of widgets and place it on a Pages: Structure functionality and appearance to display the field.
The example below creates two custom fields for subscribers - Title and Country. First, create the fields in the database, by running the following code:
Then, fill out the fields by using the code bellow. The following sample fills the fields of all the subscribers with the same data:
The fields, created above, can be used in the Like a web page mail template the same way as the other dynamic fields - {|Subscriber.Title|} and {|Subscriber.Country|}
The complete method for getting the fields' values looks like this:
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important