summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--print_mail/print_mail.admin.inc17
-rw-r--r--print_mail/print_mail.inc3
-rw-r--r--print_mail/print_mail.module1
3 files changed, 19 insertions, 2 deletions
diff --git a/print_mail/print_mail.admin.inc b/print_mail/print_mail.admin.inc
index 4bc6f42..a49e6b7 100644
--- a/print_mail/print_mail.admin.inc
+++ b/print_mail/print_mail.admin.inc
@@ -11,6 +11,9 @@
* @ingroup print
*/
+// Include MIME library
+@include_once('Mail/mime.php');
+
/**
* Menu callback for the send by e-mail module settings form.
*
@@ -146,6 +149,20 @@ function print_mail_settings() {
'#description' => t('If checked, the user will be able to choose between sending the full content or only the teaser at send time.'),
);
+ $form['settings']['print_mail_send_option_default'] = array(
+ '#type' => 'select',
+ '#title' => t('Default e-mail sending format'),
+ '#default_value' => variable_get('print_mail_send_option_default', PRINT_MAIL_SEND_OPTION_DEFAULT),
+ '#options' => array(
+ 'sendlink' => 'Link',
+ 'sendpage' => 'Inline HTML',
+ ),
+ );
+ if (class_exists('Mail_mime')) {
+ $form['settings']['print_mail_send_option_default']['#options']['inline-attachment'] = 'Inline HTML with Attachment';
+ $form['settings']['print_mail_send_option_default']['#options']['plain-attachment'] = 'Plain Text with Attachment';
+ }
+
if (module_exists('job_queue')) {
$form['settings']['print_mail_job_queue'] = array(
'#type' => 'checkbox',
diff --git a/print_mail/print_mail.inc b/print_mail/print_mail.inc
index 0fd8ddb..b9f95f1 100644
--- a/print_mail/print_mail.inc
+++ b/print_mail/print_mail.inc
@@ -97,14 +97,13 @@ function print_mail_form($form_state) {
$form['fld_send_option'] = array(
'#type' => 'select',
'#title' => t('Send page as'),
- '#default_value' => 'sendpage',
+ '#default_value' => variable_get('print_mail_send_option_default', PRINT_MAIL_SEND_OPTION_DEFAULT),
'#options' => array(
'sendlink' => 'Link',
'sendpage' => 'Inline HTML',
),
);
if (class_exists('Mail_mime')) {
- $form['fld_send_option']['#default_value'] = 'plain-attachment';
$form['fld_send_option']['#options']['inline-attachment'] = 'Inline HTML with Attachment';
$form['fld_send_option']['#options']['plain-attachment'] = 'Plain Text with Attachment';
}
diff --git a/print_mail/print_mail.module b/print_mail/print_mail.module
index f788dbb..ecdfcc2 100644
--- a/print_mail/print_mail.module
+++ b/print_mail/print_mail.module
@@ -25,6 +25,7 @@ define('PRINT_MAIL_BOOK_LINK_DEFAULT', 1);
define('PRINT_MAIL_HOURLY_THRESHOLD', 3);
define('PRINT_MAIL_TEASER_DEFAULT_DEFAULT', 1);
define('PRINT_MAIL_TEASER_CHOICE_DEFAULT', 1);
+define('PRINT_MAIL_SEND_OPTION_DEFAULT', 'sendpage');
define('PRINT_MAIL_JOB_QUEUE_DEFAULT', 0);
/**