Answers.Body: <p>I found my own answer in this api function: </p>
  
  <pre><code>civicrm_api3('contribution', 'sendconfirmation', array('id' =&gt; $result['id']));
  </code></pre>
  
  <p>This triggers the confirmation email to be sent. </p>
  
  <p>P.S. I wish there was something similar for the Event Participants, that seems to be quite trickier.  </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-14T02:26:39.217Z
Answers.LastActivityDate: 2016-01-14T02:26:39.217Z
Answers.UserDisplayName: Penar
Body: <p>On my CiviCRM site, I have a v3 API to update the status of a pending contribution (for payments sent offline). The current PHP code for this is the following: </p>
  
  <pre><code>$params = array( 
    'contribution_id' =&gt; $contribid,
    'payment_instrument_id' =&gt; 4, // check = 4
    'note' =&gt; 'Contribution record updated via group updater',
    'contribution_status_id' =&gt; 1,
    'version' =&gt; 3,
  );
  
  $result = civicrm_api( 'contribution','create',$params );
  </code></pre>
  
  <p>This works well, but I would like to be able to send a receipt to the person that submitted this contribution via this API call. Is that doable? </p>
  
Tags: <civicontribute>
Title: Send contribution receipt when updating contribution via API
ThreadText: # Send contribution receipt when updating contribution via API
  
  (Asked by: username_0 on 2016-01-12)
  
  On my CiviCRM site, I have a v3 API to update the status of a pending contribution (for payments sent offline). The current PHP code for this is the following: 
  $params = array( 
    'contribution_id' => $contribid,
    'payment_instrument_id' => 4, // check = 4
    'note' => 'Contribution record updated via group updater',
    'contribution_status_id' => 1,
    'version' => 3,
  );
  
  $result = civicrm_api( 'contribution','create',$params );
  
  This works well, but I would like to be able to send a receipt to the person that submitted this contribution via this API call. Is that doable?
  
  **Tags:** civicontribute
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-01-14. Score: 3
  
  I found my own answer in this api function: 
  civicrm_api3('contribution', 'sendconfirmation', array('id' => $result['id']));
  
  This triggers the confirmation email to be sent. 
  P.S. I wish there was something similar for the Event Participants, that seems to be quite trickier.
  
  
  ---
  
  