Further to #271338: custom user profile fields are not coming through - though the mail is now delivering the profile values correctly, it is still displaying the system field name instead of thee user-readable field title (eg. 'profile_child_firstname: ' instead of 'First Name: '. I don't know if this is intentional, an oversight or due to a difference between 5.x and 6.x, but I believe the user-readable titles would be preferable. It's easy enough to achieve by switching 'f.name' for 'f.title' on line 86 (and the concordant $field->name references below).

      $result = db_query('SELECT f.name, f.type, v.value FROM {profile_fields} f INNER JOIN {profile_values} v ON f.fid = v.fid WHERE uid = %d', $account->uid);
      while ($field = db_fetch_object($result)) {
        switch ($field->type) {
          case 'date':
            $date_field = unserialize($field->value);
            if (is_array($date_field)) {
              $date_timestamp = mktime(0, 0, 0, $date_field['month'], $date_field['day'], $date_field['year']);
              $profile_data .= sprintf("%s: %s\n", $field->name, format_date($date_timestamp));
            }
            break;
          case 'checkbox':
            if ($field->value)
              $account_data .= sprintf("%s: Checked\n", $field->name);
            else
              $account_data .= sprintf("%s: Not Checked\n", $field->name);
            break;
          default:
            $profile_data .= sprintf("%s: %s\n", $field->name, $field->value);
        }

Comments

rmiddle’s picture

Status: Active » Reviewed & tested by the community

Interesting Idea. Will keep this in mind for the next release.

rmiddle’s picture

Status: Reviewed & tested by the community » Fixed

Committed to both 5.x & 6.x CVS. Will be in 1.9 release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.