Home › Forums › Newsletter Plugin Support › subscribe in php
Hey, is there a way to create a new user in php? I searched you plugin and found
$request = array("name": "Username", "email": "user@email.com"); $module = NewsletterUsers::instance(); $request['status'] = 'C'; $request['sex'] = 'n'; unset($request['name']); $user = $module->save_user($request);
but this code returns me the “mysqli_real_escape_string() expects parameter 2 to be string, array given” error. Can you help me? Cheers Leo
Do a var_dump of your $request and check its structure. It must be an associatve arrau with at least the “email” key. Stefano.