Mailpoet Sign up on Custom registration form won’t work

On this line here:

$list = \MailPoet\API\API::MP('v1')->getLists()[0][id];

You’re missing quotes around id, so $list isn’t being set to the ID. You need to add quotes:

$list = \MailPoet\API\API::MP('v1')->getLists()[0]['id'];

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)