Index: user_relationship_mailer.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/user_relationships/user_relationship_mailer/Attic/user_relationship_mailer.module,v
retrieving revision 1.1.2.10
diff -u -r1.1.2.10 user_relationship_mailer.module
--- user_relationship_mailer.module	12 Jul 2009 17:20:27 -0000	1.1.2.10
+++ user_relationship_mailer.module	18 Nov 2009 18:00:53 -0000
@@ -30,7 +30,13 @@
   switch ($op) {
   case 'request':
     if ($relationship->approved == TRUE) {
+      global $user;
       $op = 'pre_approved';
+      // if user is not logged in, user is registering
+      // check if admin has chosen to send email from default relationships or not
+      if (! $user->uid && ! variable_get('user_relationship_mailer_send_default', TRUE)) {
+        return;
+      }
     }
   case 'cancel':
     $send_email = $send_to_requestee;
@@ -132,6 +138,14 @@
         '#default_value'  => variable_get('user_relationship_mailer_send_mail', FALSE),
         '#description'    => t('If you check this, users will have a new setting on their account edit page.'),
       );
+      if (module_exists('user_relationship_defaults')) {
+        $form['mail']['user_relationship_mailer_send_default'] = array(
+          '#type'           => 'checkbox',
+          '#title'          => t('Send default relationships mail when user registers'),
+          '#default_value'  => variable_get('user_relationship_mailer_send_default', TRUE),
+          '#description'    => t('If you check this, users will receive mail from default relationships when they register.'),
+        );
+      }
 
       global $_user_relationship_mailer_ops;
       
