Adding custom fields subscribers - General Discussions - General Discussions - Progress Community
 General Discussions

Adding custom fields subscribers

  • Adding custom fields subscribers
  • fcbe0787-4cb5-6f77-96ac-ff0000ae3c70_custom_subscriber_field.png
    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 = MetadataManager.GetManager();
    dynType = metaMan.CreateMetaType(typeof(Subscriber));
    var metaField =  metaMan.CreateMetafield('Token');
    metaField.DBSqlType = "NVARCHAR(150)";
    metaField.DBType = "LONGVARCHAR";
    metaField.ClrType = "System.String";

    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.

  • Hello Stefan,

    After the Sitefinity 5.1 release in which we have introduced the Notifications service the whole way the fields are resolved has changed. We are using the so called SubscriberRequestProxy which handles all the built in fields and displays them properly on the message, but it does not have logic for the custom fields. 

    The reason for this is that Sitefinity was never designed to be able to display those custom fields, however prior to the 5.1 release the workaround from Boyan Barnev in this forum post was working because Sitefinity was using the standard SMTP way.

    We have a PITS feature request logged in the system for this functionality. You can follow its progress and vote to increase its popularity.

    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
  • Hi Pavel,

    So what's the work around for this in latest Sitefinity version. Also I can not find PITS, can you share the link to this issue.



  • Hello Chaitanya,

    Here is the link to the feedback item my colleague Pavel refers to in his post:

    As for creating custom fields for subscribers, currently we do not have a built-in functionality to add custom fields for subscribers from the backend UI. We have logged it in our system as a feature request and hopefully will be able to implement it for our future releases. Here is a link to our feedback portal where you can track its progress and vote for it:

    In order to add a custom filed for the subscribers you will need to do this through our API as described in our documentation: Please note that you will not have access to these fields from the backend UI as it is noted in the article. But after you add the fields you will be able to access then as the other default fields in Sitefinity 6.1 and above.

    Sabrie Nedzhip
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
  • I am running Sitefinity 7.0 and have found a problem, it may be related...

    If you add your custom field to Subscriber then send an email there is caching that occurs in the database.

    1. if you run this query

    select *
    from sf_subscriber

    You will see your custom field and its values. Note: the custom field doesn't appear to be actually created in the DB until a Subscriber is saved for the 1st time following the change.

    2. Next, if you run this query... you'll see that the subscriber info is also stored in another set of tables... AFTER the 1st time they are sent an email. The resolve key value should be the ID of the Subscriber from the 1st query.

    FROM sf_notif_subscribers s
    JOIN sf_ntf_sbscrbrs_cstm_prperties p
    ON =
    WHERE s.resolve_key = ''

    3. Now if you update your custom field on the Subscriber (sf_subscriber) to any value... the sf_ntf_sbscrbrs_cstm_prperties val is not updated and this is what you see in the email.

    My guess in your case is that the sf_ntf_sbscrbrs_cstm_prperties.val is an empty string. Their code example doesn't show how to update this cached value. I'm trying to find a solution now. Simply calling SetValue for the custom field and saving does not appear to work.

    Code example I'm referring to: