? passquickset-532140.patch
Index: passquickset.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/passquickset/passquickset.module,v
retrieving revision 1.1
diff -u -p -r1.1 passquickset.module
--- passquickset.module	25 Jul 2009 13:25:22 -0000	1.1
+++ passquickset.module	27 Jul 2009 19:58:43 -0000
@@ -60,6 +60,34 @@ function passquickset_form_alter(&$form,
   $form['account'] = $new_account;
 }
 
+
+/**
+ * Implementation of hook_form_user_admin_settings_alter().
+ */
+function passquickset_form_user_admin_settings_alter(&$form, &$form_state) {
+  $form['email']['password_generated'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Password generation mail'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+    '#description' => '', // TODO
+  );
+  $form['email']['password_generated']['passquickset_password_generated_subject'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Subject'),
+    '#default_value' => variable_get('passquickset_password_generated_subject',
+      _passquickset_notify_mail('generated_subject')),
+    '#maxlength' => 180,
+  );
+  $form['email']['password_generated']['passquickset_password_generated_body'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Body'),
+    '#default_value' => variable_get('passquickset_password_generated_body',
+    _passquickset_notify_mail('generated_body')),
+    '#rows' => 3,
+  );
+}
+
 /**
  * Implementation of hook_form_alter_formname()
  */
@@ -81,6 +109,15 @@ function passquickset_form_alter_generat
   drupal_mail('passquickset', 'passgen', $user->mail, $language, $params);
 }
 
+function _passquickset_notify_mail($param) {
+  if ($param == 'generated_subject') {
+    return 'New password at !site';
+  }
+  else {
+    return "Hello @username,\r\n\r\nYour password at !site has changed. Please use @password to log in from now on.";
+  }
+}
+
 /**
  * Implementation of hook_mail().
  */
@@ -91,6 +128,7 @@ function passquickset_mail($key, &$messa
   $variables = user_mail_tokens($user, $language);
   $variables += array('@username' => $user->name, '@password' => $params['password']);
 
-  $message['subject'] = t('New password at !site', $variables, $language->language);
-  $message['body'] = t("Hello @username,\r\n\r\nYour password at !site has changed. Please use @password to log in from now on.", $variables, $language->language);
+  $message['subject'] = t(variable_get('passquickset_password_generated_subject', _passquickset_notify_mail('generated_subject')), $variables, $language->language);
+  $message['body'] = t(variable_get('passquickset_password_generated_subject', _passquickset_notify_mail('generated_body')), $variables, $language->language);
 }
+
