Results 1 to 9 of 9

Thread: Workflow Notifications Workaround

  1. #1
    tcooper_mm is offline Junior Member
    Join Date
    Sep 2009
    Posts
    1

    Exclamation Workflow Notifications Workaround

    Hello all,

    We are using Sugar Pro 5.2.0j, in order to use workflow notifications we need to have the global option for "Notifications on?" set to on, but this creates problems for our salesmen. Since we have a fairly automated task/appt/opportunity creation system, once a lead is converted to an account for instance, the assigned user is receiving quite a few emails. So we disabled notifications individually on each sugar user.

    Now when a case is created, we have a workflow to send a notification to the assigned user if the priority is "High", but this will not work if the user has their notifications turned off.

    Can anyone help me setup a workaround for this? Basically I do not wants emails sent out on new record creation of any type, I only want them sent out if mandated by a workflow.

    Thanks in advance,

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Workflow Notifications Workaround

    Try using a logic hook to send the e-mail.

    The logic hook code could, for example, examine the priority level and if it is set to "High", it would then invoke code that sends the user the e-mail notification.

    Take a look at the developer web site for further info on logic hooks: http://developer.sugarcrm.com
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    vantagejuan is offline Sugar Community Member
    Join Date
    Dec 2007
    Posts
    70

    Default Re: Workflow Notifications Workaround

    i have a similar scenario. i'm using logic hooks as workflow for emails. i don't want to have sugar send out the out of the box email notifications on assigment, but i do want to have our users not receive notifications if they choose to uncheck the "receive notifications" checkbox on their account page.

    what would be the best way to go about disabling the automatic notifications without turning them off at the system settings menu?

  4. #4
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Workflow Notifications Workaround

    You could try creating a simple before_save logic hook with $bean->save(FALSE) as its final (or only) step.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  5. #5
    vantagejuan is offline Sugar Community Member
    Join Date
    Dec 2007
    Posts
    70

    Default Re: Workflow Notifications Workaround

    let me see if i get the logic. if i create a before_save hook with the trigger being that it's a new record ($bean->id == NULL for example) and then have the hook insert $bean->save(false); the hook will trick the system into thinking that the save isn't happening and as a result not send out the automatic notifications all while still actually saving the new contacts data in the database?

    please let me know if i'm getting the logic right.

  6. #6
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Workflow Notifications Workaround

    Possibly. I haven't tested it to make sure, nor have I had to do that before, but the parameter being passed to $bean->save() determines whether or not it should send the notification, so logic would follow that if you set it to false, it wouldn't send it.

    I'd recommend you give that function a look in SugarBean.php because there might be another place within the code that checks the user configuration, thus making it invalid.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  7. #7
    vantagejuan is offline Sugar Community Member
    Join Date
    Dec 2007
    Posts
    70

    Default Re: Workflow Notifications Workaround

    It unfortunately didn't work. I guess I'll just have to customize the automatic email templates.

  8. #8
    vantagejuan is offline Sugar Community Member
    Join Date
    Dec 2007
    Posts
    70

    Default Re: Workflow Notifications Workaround

    i believe the correct way to do what i was asking is to put $bean->save($check_notify=false); in the logic hook although i've already created the template to serve a purpose so i haven't tested it.

  9. #9
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: Workflow Notifications Workaround

    This is very simple to do. Leave your notifications off and send it yourself in a logic hook for specific records using the send_assignment_notifications method of SugarBean.

    PHP Code:
    function custom_notify(&$bean$event$paremeters)
    {
         if (
    Criteria fails)
             return 
    true;

         
    // Determine correct user to notify and set $notify_id
         
    $user_to_notify = new User();
         
    $user_to_notify->retrieve($notify_id);

         
    $bean->send_assignment_notifications($user_to_notify,$current_user);

    M
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. index_login.php workaround
    By ddturbo in forum Help
    Replies: 0
    Last Post: 2008-11-10, 06:56 PM
  2. MySQL error/no workflow notifications
    By rlbyrd in forum Help
    Replies: 1
    Last Post: 2006-09-11, 09:14 PM
  3. upgrade workaround 4.00 to 4.01
    By guz843 in forum Help
    Replies: 5
    Last Post: 2006-02-13, 04:53 PM
  4. 3.5b upgrade workaround
    By ldebernardini in forum Help
    Replies: 1
    Last Post: 2005-09-01, 06:29 AM

Tags for this Thread

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
  •