Answers.Body: <p>Not sure it is necessarily by design, but adding activities via API doesn't send emails to assignees. Seems like it should if you have the option checked.</p>
  <p>You could <a href="https://lab.civicrm.org/groups/dev/-/issues/" rel="nofollow noreferrer">post an issue</a> and even potentially fix this yourself, if you're able.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-12T21:14:35.787Z
Answers.Text: Created https://civicrm.stackexchange.com/q/45078/5446
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-10T16:05:13.317Z
Answers.LastActivityDate: 2023-06-10T16:05:13.317Z
Answers.UserDisplayName: Lars SG
Answers.Body: <p>Yes, you're right, API calls do not send email notifications. Like Lars, I'm not sure whether that's intentional or not - but either way you'll have to do that yourself once you've created the activity. <a href="https://github.com/christianwach/civicrm-wp-profile-sync/blob/94f82288cd611dd62a6bafee60c96d9bb5510d56/includes/acf/acfe/form-actions/cwps-acf-acfe-form-action-activity.php#L1285-L1316" rel="nofollow noreferrer">Here's some code</a> you can adapt to your needs - the basic gist is that there are two CiviCRM settings that have a bearing on whether the email gets sent, followed by the send procedure itself.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-12T20:44:56.770Z
Answers.Text: CRM_Activity_BAO_Activity::sendToAssignee(), thanks!
Answers.UserDisplayName: wil_SRQ
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-12T11:36:25.557Z
Answers.LastActivityDate: 2023-06-12T11:36:25.557Z
Answers.UserDisplayName: Christian Wach
Body: <p>Creating an activity with either API (api3, api4) does not trigger an email to the assignee. Is this by design or is there a problem with my instance of CiviCRM? Activities generated via the GUI and via webform do send emails to assignees. The checkbox to &quot;Notify Activity Assignees&quot; in Administer &gt; Customize Data and Screens &gt; Display Preferences is checked.</p>
  <p>CiviCRM 5.61.4, Drupal 7.97</p>
  
Tags: <api><activities>
Title: Activities created by API not emailing assignee
ThreadText: # Activities created by API not emailing assignee
  
  (Asked by: username_0 on 2023-06-10)
  
  Creating an activity with either API (api3, api4) does not trigger an email to the assignee. Is this by design or is there a problem with my instance of CiviCRM? Activities generated via the GUI and via webform do send emails to assignees. The checkbox to "Notify Activity Assignees" in Administer > Customize Data and Screens > Display Preferences is checked.
  
  CiviCRM 5.61.4, Drupal 7.97
  
  **Tags:** api, activities
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-06-10. Score: 0 | Accepted answer
  
  Not sure it is necessarily by design, but adding activities via API doesn't send emails to assignees. Seems like it should if you have the option checked.
  
  You could [post an issue](https://lab.civicrm.org/groups/dev/-/issues/) and even potentially fix this yourself, if you're able.
  
  > **Comments:**
  > **username_0**: Created https://civicrm.stackexchange.com/q/45078/5446  
  
  ---
  
  ### Answer by username_2 on 2023-06-12. Score: 2
  
  Yes, you're right, API calls do not send email notifications. Like username_1, I'm not sure whether that's intentional or not - but either way you'll have to do that yourself once you've created the activity. [Here's some code](https://github.com/username_2/civicrm-wp-profile-sync/blob/94f82288cd611dd62a6bafee60c96d9bb5510d56/includes/acf/acfe/form-actions/cwps-acf-acfe-form-action-activity.php#L1285-L1316) you can adapt to your needs - the basic gist is that there are two CiviCRM settings that have a bearing on whether the email gets sent, followed by the send procedure itself.
  
  > **Comments:**
  > **username_0**: CRM_Activity_BAO_Activity::sendToAssignee(), thanks!  
  
  ---
  
  