Answers.Body: <p>The extension mentioned by Peter in the answer is now moved into core and can be used from 4.7.30 version. See <a href="https://issues.civicrm.org/jira/browse/CRM-21380" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-21380</a></p>
  
  <p>It introduces a new setting which blocks some activity types to send an email to the assignees. </p>
  
  <p>To enable this, navigate to <code>Administer -&gt; Customize Data and Screens -&gt; Display Preferences</code> and select <code>Notify Activity Assignees</code> checkbox. It will then display a multi-select box to choose some activity type which you don't wish to send notifications for.</p>
  
  <p><a href="https://i.sstatic.net/vPYiU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vPYiU.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-26T03:26:53.953Z
Answers.LastActivityDate: 2018-01-26T03:26:53.953Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>This is not available out of the box. It'd involve writing a new feature / extension.</p>
  
  <p>It looks like the magic happens in the <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Activity/BAO/Activity.php#L2770" rel="nofollow noreferrer">CRM_Activity_BAO_Activity::sendToAssignee</a> method. This method takes an activity object and an array of contacts to send the mail to.</p>
  
  <p>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:</p>
  
  <ol>
  <li>implement a hook to do the filtering, and rewrite some of the code that calls sendToAssignee so that it is aware of the hook</li>
  <li>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.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-19T19:56:10.153Z
Answers.Text: 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....
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-27T23:54:42.527Z
Answers.Text: @JoeMcLaughlin maybe! :) let us know how you get on
Answers.UserDisplayName: michaelmcandrew
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-02T21:08:32.103Z
Answers.Text: Joe - any progress with that approach?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-07T03:48:23.300Z
Answers.Text: petednz - have not had a chance to try this using CiviRules - it was causing problems with cron so had to disable it, again.
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-19T09:29:52.893Z
Answers.LastActivityDate: 2016-11-16T17:25:20.013Z
Answers.LastEditDate: 2016-11-16T17:25:20.013Z
Answers.UserDisplayName: michaelmcandrew
Answers.Body: <p>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)</p>
  
  <p>If you can help review <a href="https://issues.civicrm.org/jira/browse/CRM-20638" rel="nofollow noreferrer">CRM-20638</a> and <a href="https://github.com/civicrm/civicrm-core/pull/10417" rel="nofollow noreferrer">PR-10417</a> we can move this forward.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-18T15:15:07.800Z
Answers.Text: Aidan thanks so much and I'll check it out
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-18T14:15:26.937Z
Answers.LastActivityDate: 2017-07-18T14:15:26.937Z
Answers.UserDisplayName: Aidan
Answers.Body: <p>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</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-08T18:22:37.400Z
Answers.Text: Thanks Peter! Looking forward to checking out the extension.
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-26T04:16:14.850Z
Answers.Text: see jitendra's answer joe
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-20T03:02:50.423Z
Answers.LastActivityDate: 2017-12-20T03:02:50.423Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>We're on Civi 4.6.21 and Drupal 7. </p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>Sending e-mail notifications of Assigned Activities is really handy - but not desired in all use cases.  </p>
  
  <p>So - how can I disable Notify Activity Assignees for some Activities and/or user levels and leave it on for other Activities/user levels?</p>
  
  <p>Thanks! </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-07T00:15:32.963Z
Comments.Text: I removed civirules since this does not appear to be specific to that, and comes up in searching for Tag = civirules
Comments.UserDisplayName: petednz - fuzion
Tags: <extension><email><activities><hooks>
Title: Can I disable Notify Activity Assignees for some Activities and/or user levels and leave it on for other Activities/user levels?
ThreadText: # Can I disable Notify Activity Assignees for some Activities and/or user levels and leave it on for other Activities/user levels?
  
  (Asked by: username_0 on 2016-09-16)
  
  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!
  
  **Tags:** extension, email, activities, hooks
  
  > **Comments:**
  > **username_1**: I removed civirules since this does not appear to be specific to that, and comes up in searching for Tag = civirules  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_2 on 2018-01-26. Score: 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](https://i.sstatic.net/vPYiU.png)](https://i.sstatic.net/vPYiU.png)
  
  
  ---
  
  ### Answer by username_3 on 2016-09-19. Score: 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](https://github.com/civicrm/civicrm-core/blob/master/CRM/Activity/BAO/Activity.php#L2770) 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.
  
  > **Comments:**
  > **username_0**: username_3 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....  
  > **username_3**: @username_0 maybe! :) let us know how you get on  
  > **username_1**: Joe - any progress with that approach?  
  > **username_0**: username_1 - have not had a chance to try this using CiviRules - it was causing problems with cron so had to disable it, again.  
  
  ---
  
  ### Answer by username_4 on 2017-07-18. Score: 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](https://issues.civicrm.org/jira/browse/CRM-20638) and [PR-10417](https://github.com/civicrm/civicrm-core/pull/10417) we can move this forward.
  
  > **Comments:**
  > **username_0**: username_4 thanks so much and I'll check it out  
  
  ---
  
  ### Answer by username_1 on 2017-12-20. Score: 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
  
  > **Comments:**
  > **username_0**: Thanks Peter! Looking forward to checking out the extension.  
  > **username_1**: see username_2's answer joe  
  
  ---
  
  