Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas Nilsson 137 posts 260 karma points
    Oct 05, 2013 @ 07:59
    Jonas Nilsson
    0

    Verify post by email

    Hi!

    When the Countour form is submitted, (containing the submitter email and some fields), I will send an email containing a verification link (containing the recordId) that points back to my site.

    Does anyone have an razor example of how to update an field (IsVerified) in a record by it's recordId?

    /Jonas

     

     

     

  • Comment author was deleted

    Oct 05, 2013 @ 11:42

    Might be better to set it to manual approve and then when it has been vericated set the state to approved (you don't need to have the isVerified field then)

    Will see if I can find an example of that

  • Jonas Nilsson 137 posts 260 karma points
    Oct 05, 2013 @ 11:51
    Jonas Nilsson
    0

    Yes, I will use the manual approve also, but I would like to verify the submitters email adress by sending an verification link.

    /Jonas

     

  • Jonas Nilsson 137 posts 260 karma points
    Oct 05, 2013 @ 20:31
    Jonas Nilsson
    100

    Solved!

    var recordId = Request["post"];

    if (!string.IsNullOrWhiteSpace(recordId))
    {
    try
    {
    var guid = new Guid(recordId);
    using (var storage = new RecordStorage())
    {
    var record = storage.GetRecord(guid);
    var form = new FormStorage().GetFormFromRecordId(record.Id);
    var service = new RecordService(record);

    var verifiedRecordField = record.GetRecordField("Verified");
    verifiedRecordField.Values.Clear();
    verifiedRecordField.Values.Add("1");

    storage.UpdateRecord(record,form);
    storage.UpdateRecordXml(record,form);

    @Verified()
    }

    }
    catch(Exception ex)
    {
    @Error();
    }  
    }

     

Please Sign in or register to post replies

Write your reply to:

Draft