Answers.Body: <p>I would think that using a custom template would work, there is a thank you page template. If it is only one contribution page you're looking to add, some quick logic based on contribution page id would work. You can also try some custom behaviors with jQuery: <a href="https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates" rel="nofollow">https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-10T20:17:42.983Z
Answers.LastActivityDate: 2015-12-10T20:17:42.983Z
Answers.UserDisplayName: RayWright
Answers.Body: <p>The best way (I would recommend) to do is to create an own page of your own - and displaying the thank you page </p>
  
  <p>Or overriding the thank you page from core into civicrm custom folder - that will solve the problem </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-28T10:13:05.563Z
Answers.LastActivityDate: 2015-10-28T10:13:05.563Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.Body: <p>You can customize the thank you page using custom  template. </p>
  
  <p><a href="http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551" rel="nofollow">http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-28T20:22:45.217Z
Answers.LastActivityDate: 2015-11-28T20:22:45.217Z
Answers.UserDisplayName: Prem Patel
Answers.Body: <p>You can also customize the thank you page using custom template. </p>
  
  <p><a href="http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551" rel="nofollow">http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-28T20:24:46.097Z
Answers.LastActivityDate: 2015-11-28T20:24:46.097Z
Answers.UserDisplayName: Prem Patel
Answers.Body: <p>I would expect that the Contribution Page does not trigger the postProcess hook as this operates on forms, not on pages. I would imagine you could use the pageRun hook though? I have not tried it....</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-28T03:28:50.223Z
Answers.Text: Thanks for the suggestion to try pageRun.  Unfortunately, as far as civi is concerned, the thank you screen displayed after a contribution is neither a Form nor a Page.  Arg.
Answers.UserDisplayName: Peter_
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-28T12:11:11.983Z
Answers.Text: Worth a try, a pity it did not work :-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-27T09:04:24.950Z
Answers.LastActivityDate: 2015-10-27T09:04:24.950Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>Big picture: I want to display some custom data on a thank you page for a specific contribution page.   In my module I'm using hook_civicrm_preProcess.   Like so:</p>
  
  <pre><code>   function custom_thankyou_civicrm_preProcess($formName, &amp;$form) {
  
  if ($formName == "CRM_Contribute_Form_ContributionPage_ThankYou" &amp;&amp; ($form-&gt;getVar('_id') == 5)) {   
  
  // do stuff, like send my custom data to a smarty template. 
  
  } }
  </code></pre>
  
  <p>But here's the problem, my customized message doesn't show up on the thank you page for that contribution.  It does however show up on the configuration screen for "Thank-you and Receipting" in the civi interface.  </p>
  
  <p>I guess it's not too surprising since the url for the config page is:</p>
  
  <p>mycivicrmhost/index.php?q=civicrm/admin/contribute/thankyou&amp;reset=1&amp;action=update&amp;id=5</p>
  
  <p>and the url for the thank you page ends up being one like this:</p>
  
  <p>mycivicrmhost/index.php?q=civicrm/contribute/transact&amp;_qf_ThankYou_display=1&amp;qfKey=3ee9c31da51b3af9dbe8c8efa5765520_1396</p>
  
  <p>Is it possible to do this or should I set up an "external" thank you page instead?</p>
  
  <p>Thank you</p>
  
Tags: <contribution-page><hooks>
Title: How do I hook into a contribution thank you page?
ThreadText: # How do I hook into a contribution thank you page?
  
  (Asked by: username_0 on 2015-10-27)
  
  Big picture: I want to display some custom data on a thank you page for a specific contribution page. In my module I'm using hook\_civicrm\_preProcess. Like so:
  
  ```
     function custom_thankyou_civicrm_preProcess($formName, &$form) {
  
  if ($formName == "CRM_Contribute_Form_ContributionPage_ThankYou" && ($form->getVar('_id') == 5)) {   
  
  // do stuff, like send my custom data to a smarty template. 
  
  } }
  
  ```
  
  But here's the problem, my customized message doesn't show up on the thank you page for that contribution. It does however show up on the configuration screen for "Thank-you and Receipting" in the civi interface.
  
  I guess it's not too surprising since the url for the config page is:
  
  mycivicrmhost/index.php?q=civicrm/admin/contribute/thankyou&reset=1&action=update&id=5
  
  and the url for the thank you page ends up being one like this:
  
  mycivicrmhost/index.php?q=civicrm/contribute/transact&\_qf\_ThankYou\_display=1&qfKey=3ee9c31da51b3af9dbe8c8efa5765520\_1396
  
  Is it possible to do this or should I set up an "external" thank you page instead?
  
  Thank you
  
  **Tags:** contribution-page, hooks
  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_1 on 2015-12-10. Score: 1
  
  I would think that using a custom template would work, there is a thank you page template. If it is only one contribution page you're looking to add, some quick logic based on contribution page id would work. You can also try some custom behaviors with jQuery: <https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates>
  
  
  ---
  
  ### Answer by username_2 on 2015-10-28. Score: 0
  
  The best way (I would recommend) to do is to create an own page of your own - and displaying the thank you page
  
  Or overriding the thank you page from core into civicrm custom folder - that will solve the problem
  
  
  ---
  
  ### Answer by username_3 on 2015-11-28. Score: 0
  
  You can customize the thank you page using custom template.
  
  <http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551>
  
  
  ---
  
  ### Answer by username_3 on 2015-11-28. Score: 0
  
  You can also customize the thank you page using custom template.
  
  <http://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/86213551>
  
  
  ---
  
  ### Answer by username_4 on 2015-10-27. Score: 0
  
  I would expect that the Contribution Page does not trigger the postProcess hook as this operates on forms, not on pages. I would imagine you could use the pageRun hook though? I have not tried it....
  
  > **Comments:**
  > **username_0**: Thanks for the suggestion to try pageRun.  Unfortunately, as far as civi is concerned, the thank you screen displayed after a contribution is neither a Form nor a Page.  Arg.  
  > **username_4**: Worth a try, a pity it did not work :-)  
  
  ---
  
  