Adding custom fields to newsletters subscribers

Posted by Community Admin on 03-Aug-2018 09:16

Adding custom fields to newsletters subscribers

All Replies

Posted by Community Admin on 02-May-2013 00:00

I tried adding custom field to a subscriber.
I used this code:

var metaMan = MetadataManager.GetManager();
var dynType = metaMan.GetMetaType(typeof(Subscriber));
if (dynType != null)
          metaMan.Delete(dynType);
          metaMan.SaveChanges(true);
metaMan = MetadataManager.GetManager();
dynType = metaMan.CreateMetaType(typeof(Subscriber));
var metaField =  metaMan.CreateMetafield('Token');
metaField.DBSqlType = "NVARCHAR(150)";
metaField.DBType = "LONGVARCHAR";
metaField.ClrType = "System.String";
dynType.Fields.Add(metaField);
metaMan.SaveChanges(true);


I checked the database, and the field is there, i populated this field with data, but I can't retrieve values.
I tried with |Subscriber.Token| in message template, but is empty every time.

Please help,
Stefan

Posted by Community Admin on 06-May-2013 00:00

Hello Stefan,

This is a duplicated forum thread. You have been given an answer in the initial thread here.

All the best,
Pavel Benov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed