2

We're on Civi 4.6.21 and Drupal 7.

Under Administer -> Customize Data and Screens -> Display Settings there is a setting - "Notify Activity Assignees - When enabled, contacts who are assigned activities will automatically receive an email notification with a copy of the activity." - with a checkbox to enable the setting.

I want to be able to send e-mail notifications based on Activity type, or Activity Subject, or Campaign to which that Activity is linked, or Assigned To contact user level - so, for example, staff who are Assigned an Activity called Membership Signup (of a 'target' contact, the With contact) always receive an e-mail notification; but, volunteers who are Assigned an Activity of Card Signup, with Subject of Protect Puppies as part of a Campaign called Protect Puppies 2016, do not receive an e-mail notification of that Assigned Activity.

Sending e-mail notifications of Assigned Activities is really handy - but not desired in all use cases.

So - how can I disable Notify Activity Assignees for some Activities and/or user levels and leave it on for other Activities/user levels?

Thanks!

  • I removed civirules since this does not appear to be specific to that, and comes up in searching for Tag = civirules – petednz - fuzion Nov 7 '16 at 0:15
3

The extension mentioned by Peter in the answer is now moved into core and can be used from 4.7.30 version. See https://issues.civicrm.org/jira/browse/CRM-21380

It introduces a new setting which blocks some activity types to send an email to the assignees.

To enable this, navigate to Administer -> Customize Data and Screens -> Display Preferences and select Notify Activity Assignees checkbox. It will then display a multi-select box to choose some activity type which you don't wish to send notifications for.

enter image description here

2

This is not available out of the box. It'd involve writing a new feature / extension.

It looks like the magic happens in the CRM_Activity_BAO_Activity::sendToAssignee method. This method takes an activity object and an array of contacts to send the mail to.

So would involve a bit of coding, I'm afraid, but is a job that could / should be done "the right way [tm]". Which I will be so bold as to suggest is:

  1. implement a hook to do the filtering, and rewrite some of the code that calls sendToAssignee so that it is aware of the hook
  2. write an extension that with a UI that implements the hook so that configuration is easier and people don't have to write code each time they want to implement the hook.
  • 2
    michaelmcandrew thanks so much for pointing me to the right place in the core code. I'm wondering if I can do what I want using CiviRules instead - leave Notify Activity Assignees of in Settings and create a CiviRule for each particular use case to notify activity assignees via e-mail. Hmmm.... – Joe McLaughlin Sep 19 '16 at 19:56
  • @JoeMcLaughlin maybe! :) let us know how you get on – michaelmcandrew Sep 27 '16 at 23:54
  • Joe - any progress with that approach? – petednz - fuzion Nov 2 '16 at 21:08
  • petednz - have not had a chance to try this using CiviRules - it was causing problems with cron so had to disable it, again. – Joe McLaughlin Nov 7 '16 at 3:48
1

Just come across this old question. I wrote a hook for this a while back that needs some attention. (Part 1 of Michael's answer)

If you can help review CRM-20638 and PR-10417 we can move this forward.

  • Aidan thanks so much and I'll check it out – Joe McLaughlin Jul 18 '17 at 15:15
1

We have an extension for this now. It is going through some testing process, but since I stumbled on this I thought I should update here. Will add more when it gets published

  • Thanks Peter! Looking forward to checking out the extension. – Joe McLaughlin Jan 8 '18 at 18:22
  • see jitendra's answer joe – petednz - fuzion Jan 26 '18 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.