// id of the member we wish to update
$memberId = 2;
// array of newsletter channel's id
$arrNewsletter = array("1");
$objMember = \MemberModel::findByPk($memberId);
// first sync the newsletter
$objNewsletter = new \Newsletter();
$objNewsletter->synchronize($arrNewsletter, $objMember)
// after syncing update the member model
$objMember->newsletter = $arrNewsletter;
$objMember->save();