I'm currently able to add a user with the following code (from the Docs):
$user = new UserModel();
$user->username = 'tommy';
$user->firstName = 'Tom';
$user->lastName = 'Foolery';
$user->email = 'tom@thefoolery.com';
$success = craft()->users->saveUser($user);
if (!$success)
{
Craft::log('Couldn’t save the user "'.$user->username.'"', LogLevel::Error);
}
How can I also set the Profile Company name??
I've tried the following with no luck:
$user->company = 'ACME';
$user->setContent([ 'fields' => ['company' => 'ACME'] ]);
$user->validate()return? – Brad Bell Jul 24 '15 at 16:59