BPM: notify a favorite user

Hello, is it possible through sugarbpm to notify a user who has indicated a record as a favorite?

I'll explain better:

  • user 1 indicates the ABC account as a favorite
  • a note (or call or meeting) related to the ABC account is created
  • through BPM I would like to send an email to all users who have indicated the ABC account as a favorite

Thanks,

Mirco

Parents
  • You could also achieve this with a custom after_relationship_add logic hook on the account.

    The MailerFactory makes it easy to send an email.

    I have not played with this before but Favorites are stored in the SugarFavorites module so you should be able to use the "accounts_favorite" link which links the Users module to the Accounts module for this purpose, and the Users related to the Account, and their primary email address from there, at which point you can compose a group email, or email the users individually and let them know which Related record was added to that Account.

    Per the Accounts vardefs:

        'accounts_favorite' =>
        array (
          'lhs_module' => 'Users',
          'lhs_table' => 'users',
          'lhs_key' => 'id',
          'rhs_module' => 'Accounts',
          'rhs_table' => 'accounts',
          'rhs_key' => 'id',
          'relationship_type' => 'user-based',
          'join_table' => 'sugarfavorites',
          'join_key_lhs' => 'modified_user_id',
          'join_key_rhs' => 'record_id',
          'relationship_role_column' => 'module',
          'relationship_role_column_value' => 'Accounts',
          'user_field' => 'created_by',
        ),
    

    I don't know if you've considered this, but maybe, instead of creating more email, Following/Favoriting records would be enough for your business purpose?

    https://support.sugarcrm.com/Documentation/Sugar_Versions/12.0/Ent/Application_Guide/User_Interface/#Following_Records

    FrancescaS

Reply
  • You could also achieve this with a custom after_relationship_add logic hook on the account.

    The MailerFactory makes it easy to send an email.

    I have not played with this before but Favorites are stored in the SugarFavorites module so you should be able to use the "accounts_favorite" link which links the Users module to the Accounts module for this purpose, and the Users related to the Account, and their primary email address from there, at which point you can compose a group email, or email the users individually and let them know which Related record was added to that Account.

    Per the Accounts vardefs:

        'accounts_favorite' =>
        array (
          'lhs_module' => 'Users',
          'lhs_table' => 'users',
          'lhs_key' => 'id',
          'rhs_module' => 'Accounts',
          'rhs_table' => 'accounts',
          'rhs_key' => 'id',
          'relationship_type' => 'user-based',
          'join_table' => 'sugarfavorites',
          'join_key_lhs' => 'modified_user_id',
          'join_key_rhs' => 'record_id',
          'relationship_role_column' => 'module',
          'relationship_role_column_value' => 'Accounts',
          'user_field' => 'created_by',
        ),
    

    I don't know if you've considered this, but maybe, instead of creating more email, Following/Favoriting records would be enough for your business purpose?

    https://support.sugarcrm.com/Documentation/Sugar_Versions/12.0/Ent/Application_Guide/User_Interface/#Following_Records

    FrancescaS

Children