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!

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

4 Answers 4

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.
4
  • 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.... Commented Sep 19, 2016 at 19:56
  • @JoeMcLaughlin maybe! :) let us know how you get on Commented Sep 27, 2016 at 23:54
  • Joe - any progress with that approach?
    – petednz - fuzion
    Commented Nov 2, 2016 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. Commented Nov 7, 2016 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.

1
  • Aidan thanks so much and I'll check it out Commented Jul 18, 2017 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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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