the subject field in the email submodule settings is multiline but should be single line instead.

Comments

kbahey’s picture

Status: Active » Postponed (maintainer needs more info)

Can you submit a patch for it?

fhelmschrott’s picture

as i'm not a good coder yet and not deeply into drupal i think it's better not to patch this thing into bad stuff ;) I'll work on it to submit patches later.

kylehase’s picture

Version: 5.x-2.11 » 5.x-2.14
Component: Code: userpoints_email.module » Code: userpoints_email
Category: support » bug

In response to http://drupal.org/node/155114

This patch worked for me on 5.x-2.14.

--- userpoints_email.module     2007-10-05 03:10:12.000000000 -1000
+++ userpoints_email.module.new 2007-10-05 03:08:25.000000000 -1000
@@ -7,7 +7,7 @@
 define('USERPOINTS_EMAIL_SUBJECT',         'userpoints_email_subject');
 define('USERPOINTS_EMAIL_POINTS',          'userpoints_email_points');
 define('USERPOINTS_EMAIL_TEXT_DEFAULT',    "!username,\n\nCongratulations!\nYou now have !points.\n");
-define('USERPOINTS_EMAIL_SUBJECT_DEFAULT', 'Congratulations');
+define('USERPOINTS_EMAIL_SUBJECT_DEFAULT', 'Thank you!');

 function userpoints_email_help($section) {
   switch ($section) {
@@ -38,11 +38,11 @@
       );

       $form[$group][USERPOINTS_EMAIL_SUBJECT] = array(
-        '#type' => 'textarea',
+        '#type' => 'textfield',
         '#title' => t('Subject of email to sent.'),
         '#default_value' => variable_get(USERPOINTS_EMAIL_SUBJECT, USERPOINTS_EMAIL_SUBJECT_DEFAULT),
         '#width' => 70,
-        '#lines' => 5,
+       '#lines' => 1,
       );

       $form[$group][USERPOINTS_EMAIL_TEXT] = array(
@@ -75,11 +75,10 @@
     $user = user_load(array('uid' => $uid));

     $from = variable_get('site_mail', ini_get('sendmail_from'));
-    $headers = "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from";

     drupal_mail('userpoints_email',
       $user->mail, $subject, t(variable_get(USERPOINTS_EMAIL_TEXT, USERPOINTS_EMAIL_TEXT_DEFAULT),
       array('!username' => $user->name, '!points' => $current_points)),
-      $headers);
+       $from);
   }
 }
jredding’s picture

Assigned: Unassigned » jredding
Status: Postponed (maintainer needs more info) » Closed (fixed)

incorporated into v3. in CVS.

jredding’s picture

Project: User Points » User Points Contributed modules
Version: 5.x-2.14 » 5.x-2.x-dev