How do I set the Post field after manipulation I'm trying to write a simple plugin that will intercept registration form's data, manipulate it and move it forward. What I'm struggling with is how to set the Post content of a field after the manipulation.

I'm trying to achieve something like that, how do I set the Post field after manipulation, setRawPostContent doesn't seem to work here.

 craft()-&gt;on('users.onBeforeSaveUser', function(Event $event) {

        if(craft()-&gt;request-&gt;isSiteRequest())
        {
            $companyId = craft()-&gt;request-&gt;getPost('email');
            $event-&gt;params['user']-&gt;setRawPostContent('fields[companyId]', $companyId);
        }

    });
If you're just looking to update a custom field on the user, something like this should do it:

craft()-&gt;on('users.onBeforeSaveUser', function(Event $event) {

    if(craft()-&gt;request-&gt;isSiteRequest())
    {
        $companyId = craft()-&gt;request-&gt;getPost('email');
        $event-&gt;params['user']-&gt;getContent()-&gt;companyId = $companyId;
    }

});