HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.

weird characters in new member confirmation mail's subject if forum name contains special characters

edited October 2009 in Vanilla 1.0 Help
Our forum's title is in German and contains an Umlaut ("München"). If new members are confirmed by an admin they receive an email with this subject:

"M������������������������������������������"

My question: in which file can I find the code building the confirmation mail's subject?

BTW: strange thing is that all other mails' subjects like the ones sent by the Notifi extension also are referencing the forum title but obviously don't have any problem with the Umlaut...

Comments

  • UPDATE:
    found the files where this subject is created (library/People/People.Class.UserManager.php and definition.php in my localization folder). And I somehow got it to work, but only if I hard-code the title into the mail's subject, which I really don't like.
    Obviously my PHP knowledge is way too limited so I really don't know how to get where I want to get:

    This line obvioulsy reads the forum title and then a localized string that is appended:

    $e->Subject = $this->Context->Configuration['APPLICATION_TITLE'].' '.$this->Context->GetDefinition('AccountChangeNotification');

    Now, the application title is "Mein München Forum". So the hard-coded subject is (I googled that snippet):

    $e->Subject = '=?ISO-8859-1?Q?Mein M=FCnchen Forum?='.' - '.$this->Context->GetDefinition('AccountChangeNotification');

    If however I *don't* replace the "ü" with the ASCII code "=FC" - which is the case in my APPLICATION_TITLE field - the code breaks.

    How can I get to where I need to be?

    Many thanks in advance!
    -LM
  • MarkMark Vanilla Staff
    That's a really strange one. Obviously this has something to do with character encoding. The subject is built here:

    http://code.google.com/p/lussumo-vanilla/source/browse/trunk/src/library/People/People.Class.UserManager.php#152

    $e->Subject = $this->Context->Configuration['APPLICATION_TITLE'].' '.$this->Context->GetDefinition('AccountChangeNotification');

    As you can see, it concatenates the application title and the "AccountChangeNotification" definition. I'd look at your settings file to see what character encoding it uses, as it's most likely caused by the application title since your language definitions seem to work fine everywhere else.
  • MarkMark Vanilla Staff
    I'm not great with character encodings. Can't you just do this?

    $e->Subject = 'Mein München Forum - '.$this->Context->GetDefinition('AccountChangeNotification');
  • Mark,
    thanks for your reply. Yep I found that passage, and if I hard-code the title into it instead of reading it from the field then I can encode it (see my 2nd post above). I'll see what I can find in the settings, as you recommended. Strange thing though is that this bad encoding habit only seems to apply to the APPLICATION_TITLE field, as everything else is encoded correctly.
    Unfortunately I'm close to agnostic when it comes to PHP, although I admit that the concepts seem to be quite simple; but there's so little time for so much to learn... ;-)
  • MarkMark Vanilla Staff
    :D - I'll do some testing on my end before the final release.
Sign In or Register to comment.