I am a new user of this module. I have to import a large list of name/emailaddresses from an excel-sheet. To do this I save the sheet as a (unicode)text file. As a result all names have one or tabs (\t) and superfluous spaces in the name. I wrote a few lines of code that can help other users to cleanup the realname.
In the common function: _simplenews_realname_set_realname() before the drupal_write_record statement I inserted:

    $realname = trim($realname);
    $parts = explode("\t", $realname);
    if ($parts > 1) {
      $realname = implode(' ', $parts);
    }
    while (strpos($realname, '  ') !== FALSE) {
      $realname = str_replace(array('   ', '  '), ' ', $realname);
    }

If you find it of interest you can insert it in the module.
Thanks for you work.

Comments

sgabe’s picture

Status: Active » Needs work

I think a preg_replace() would be nicer.

sgabe’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Closing due to end of support for Drupal 6.