Body: <p>I want to create a custom activity with actions (ie one that does something rather than just record information). The actions are API calls using data from the activity.  </p>
  
  <p>One option would be to create the custom activities (as managed entities), and use a <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_post" rel="nofollow">post hook</a> to implement the actions.  Is that the preferred way or is there something better?  </p>
  
  <p>CiviRules is possible but is essentially the same using a post hook.  </p>
  
  <p>CiviCRM 4.7.x Drupal 7</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-28T15:41:18.757Z
Comments.Text: Why not use CiviRules?
Comments.UserDisplayName: KarinG - Semper IT
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-30T09:46:21.007Z
Comments.Text: Yes, CiviRules is possible although I'd need to write a custom action which is most of the work of an extension to do it directly.  CiviRules is fine for some things but this question isn't about the merits of CiviRules; it is about how to implement a custom action in an extension.
Comments.UserDisplayName: Aidan
Tags: <extension><activities>
Title: How do I implement actions for a custom activity?
ThreadText: # How do I implement actions for a custom activity?
  
  (Asked by: username_0 on 2016-06-28)
  
  I want to create a custom activity with actions (ie one that does something rather than just record information). The actions are API calls using data from the activity.
  
  One option would be to create the custom activities (as managed entities), and use a [post hook](https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_post) to implement the actions. Is that the preferred way or is there something better?
  
  CiviRules is possible but is essentially the same using a post hook.
  
  CiviCRM 4.7.x Drupal 7
  
  **Tags:** extension, activities
  
  > **Comments:**
  > **username_1**: Why not use CiviRules?  
  > **username_0**: Yes, CiviRules is possible although I'd need to write a custom action which is most of the work of an extension to do it directly.  CiviRules is fine for some things but this question isn't about the merits of CiviRules; it is about how to implement a custom action in an extension.  
  
  ---
  
  ## 0 answers
  
  