Results 1 to 7 of 7

Thread: No notification mail sent on project task assignment

  1. #1
    trusti is offline Sugar Community Member
    Join Date
    Aug 2008
    Posts
    13

    Default No notification mail sent on project task assignment

    We use notification email widely in sugar
    In the very last days we start using also the project module, but no mail are sent on assignment
    I would like to confirm tha:
    -mail settings are correctly configured
    -all accounts accept notification email
    -assignment mail are regulary sent on other modules (account, contact,lead, bug, case, etc.)
    -we are on sugarCE 6.1.1

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: No notification mail sent on project task assignment

    As far I know Projects modules doesn't support notification email assignment.

    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    trusti is offline Sugar Community Member
    Join Date
    Aug 2008
    Posts
    13

    Default Re: No notification mail sent on project task assignment

    Quote Originally Posted by andopes View Post
    As far I know Projects modules doesn't support notification email assignment.

    Regards
    Thanks for the answer

    I'm trying to do it as logical hook

  4. #4
    theone is offline Member
    Join Date
    Jan 2008
    Posts
    7

    Default Re: No notification mail sent on project task assignment

    Did you ever get it to work? I'm trying to figure out how to get Project tasks to send emails as well. It seems silly to create project tasks and then need to create tasks so the person gets an email notification.

  5. #5
    trusti is offline Sugar Community Member
    Join Date
    Aug 2008
    Posts
    13

    Default Re: No notification mail sent on project task assignment

    Yes, we did it as logical hook

    you can find resources googling

    we are using a simple function for using the email module of sugar (I've attached it)
    then a function called by logical hook after save that check the name of the new assigned_user with the old one: if they differ we send the mail

    PHP Code:

    <?php
    require_once('modules/Users/User.php');
    require_once 
    'custom/include/sendSugarPHPMail.php';

        if (!
    defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

        class 
    send_notification{
                
                var 
    $debugTI=FALSE;

            function 
    send_notification(&$bean$event$arguments){
                        global 
    $current_user;
                        if (
    $this->debugTI) {
                            foreach (
    $_REQUEST as $key => $value) {
                                
    error_log('request: '.$key .' ' .$value);
                            }
                            foreach (
    $_SERVER as $key => $value) {
                                
    error_log('request: '.$key .' ' .$value);
                            }
                        }
                        
    $GLOBALS['log']->info("start send task notification");

                        if (
    $this->debugTI) {
                            
    error_log("Dentro");

                            
    error_log("assigned:" $bean->fetched_row['assigned_user_id']);
                            
    error_log("assigned nuovo:" $bean->assigned_user_id);

                            
    error_log("if" . ((!empty($bean->fetched_row['assigned_user_id']) &&
                                    !empty(
    $bean->assigned_user_id)) &&
                                    (
    $bean->fetched_row['assigned_user_id'] != $bean->assigned_user_id)));
                        }

                        if ((!empty(
    $bean->fetched_row['assigned_user_id']) &&
                               !empty(
    $bean->assigned_user_id)) &&
                               (
    $bean->fetched_row['assigned_user_id'] !=$bean->assigned_user_id)){
                            
    $new_user= new User();
                            if (
    $this->debugTI) {
                                
    $user_met=get_class_methods($new_user);
                                foreach (
    $user_met as $value) {
                                    
    error_log($value);
                                }
                            }
                            
    $new_user->retrieve($bean->assigned_user_id);
                            
    $subject "Progetto: {$bean->project_name} - Task: {$bean->name}";
                            
    $body "{$current_user->name} ha assegnato il task a: {$bean->assigned_user_name}\n";
                            
    $body .= 'Description: ' . (empty($bean->description)? ' n/a ' $bean->description) . "\n";
                            
    //$body .= '<a href=\''.$_SERVER['HTTP_REFERER'].'?module='.$_REQUEST['module'].'&action=DetailView&record='.$bean->fetched_row['id'].'\'> '.$_SERVER['HTTP_REFERER'].'?module='.$_REQUEST['module'].'&action=DetailView&record='.$bean->fetched_row['id'].'</a>';
                            
    $body .= '<'.$_SERVER['HTTP_REFERER'].'?module='.$_REQUEST['module'].'&action=DetailView&record='.$bean->fetched_row['id'].'>';
                            
    $email=$new_user->getUsersNameAndEmail();

                            if (
    $this->debugTI) {
                                foreach (
    $email as $key => $value) {
                                    
    error_log('mail'.$key .' ' .$value);
                                }
                            }
                            
    $to[$email['name']] = $email['email'];
                            
    $GLOBALS['log']->info($new_user->first_name" send task notification");

                            if (!
    sendSugarPHPMail($to$subject$body)){
                                    
    $GLOBALS['log']->info("Could not send project task notification:  " $mail->ErrorInfo);
                            }
                        }
            }
                    
                    public function 
    getEmail($obj) {
            
    $info User::getEmailInfo($obj->id);
            return 
    $info['email'];
        }

        }

    ?>
    Attached Files Attached Files

  6. #6
    garciasanchezdaniel's Avatar
    garciasanchezdaniel is offline Sugar Community Member
    Join Date
    Aug 2011
    Location
    Spain
    Posts
    403

    Default Re: No notification mail sent on project task assignment

    Quote Originally Posted by trusti View Post
    We use notification email widely in sugar
    In the very last days we start using also the project module, but no mail are sent on assignment
    I would like to confirm tha:
    -mail settings are correctly configured
    -all accounts accept notification email
    -assignment mail are regulary sent on other modules (account, contact,lead, bug, case, etc.)
    -we are on sugarCE 6.1.1
    Hello, I love this idea. I'd like to send assignment mail at the module named contacts, but I don't know how to do it.
    In addition, I have not configurated my mail. Can you help me trusti?
    Daniel

  7. #7
    trusti is offline Sugar Community Member
    Join Date
    Aug 2008
    Posts
    13

    Default Re: No notification mail sent on project task assignment

    You can configure all in the admin page, accesible with the admin account
    The contact module will send an email to the user which the contact is assigned to (if is changed than before)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 6.1.4 - Task Assignment Notification
    By bberglund in forum Help
    Replies: 0
    Last Post: 2011-05-12, 06:57 PM
  2. Replies: 4
    Last Post: 2010-10-22, 04:39 AM
  3. Replies: 2
    Last Post: 2010-09-27, 06:39 PM
  4. Replies: 23
    Last Post: 2010-04-08, 12:13 PM
  5. Replies: 9
    Last Post: 2009-04-29, 03:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •