Answers.Body: <p>As of 5.36 this wouldn't be possible in a way consistent with other activity types anyway, because if there's multiple recipients the system will now create multiple activities, so in 5.36+ the form doesn't correspond to a single activity like with other activity types.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-16T02:48:07.887Z
Answers.LastActivityDate: 2021-03-16T02:48:07.887Z
Answers.UserDisplayName: Demerit
Body: <p>Normally during hook_civicrm_postProcess, you can get the id of the just created activity from <code>$form-&gt;_activityId</code>. For activities of type Email, I can't see how to get the activity id. Am I just missing something simple?</p>
  <p>I don't think I can use hook_civicrm_post instead because I want to use information in the form that isn't in the activity object, but the form info isn't available in hook_civicrm_post.</p>
  
Tags: <activities>
Title: For activities of type Email, how do I get the id for the activity just created during hook_civicrm_postProcess?
ThreadText: # For activities of type Email, how do I get the id for the activity just created during hook_civicrm_postProcess?
  
  (Asked by: username_0 on 2020-11-18)
  
  Normally during hook\_civicrm\_postProcess, you can get the id of the just created activity from `$form->_activityId`. For activities of type Email, I can't see how to get the activity id. Am I just missing something simple?
  
  I don't think I can use hook\_civicrm\_post instead because I want to use information in the form that isn't in the activity object, but the form info isn't available in hook\_civicrm\_post.
  
  **Tags:** activities
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-03-16. Score: 0 | Accepted answer
  
  As of 5.36 this wouldn't be possible in a way consistent with other activity types anyway, because if there's multiple recipients the system will now create multiple activities, so in 5.36+ the form doesn't correspond to a single activity like with other activity types.
  
  
  ---
  
  