CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Hook to handle additionnals actions after online form submit
Pages: [1]

Author Topic: Hook to handle additionnals actions after online form submit  (Read 916 times)

frinaldi

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6.17
  • MySQL version: 5.1.48
  • PHP version: 5.2.10
Hook to handle additionnals actions after online form submit
July 14, 2011, 12:54:56 am
Hi everybody,

I have design an online form to register multiple participant to an event. We are using CiviCRM 3.3.
The first participant (the main one) should be handle differently then the other ones (accompanying personn).
So I need :
  • to change the role of the other participant from the standard online form role (that is OK for the first one) to another role.
  • to create a relationship for the first participant
  • to send a copy of the email to another person
My question is : what are the correct hook action to manage this?
  • hook_civicrm_pre for the role?
  • hook_civicrm_post for the relationship
  • what for the additionnal email?

Many thanks for all your help and for this great solution that is CiviCRM.

Fred

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Hook to handle additionnals actions after online form submit
July 15, 2011, 01:43:25 pm

i would do most of the below in hook_civicrm_postProcess on the confirm page of event registration.

To send a copy of the email to another person, you can do that from event settings and add cc/bcc to it

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

frinaldi

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6.17
  • MySQL version: 5.1.48
  • PHP version: 5.2.10
Re: Hook to handle additionnals actions after online form submit
July 17, 2011, 04:45:36 am
Many thanks Lobo.
For the additionnal password, I can't do this using the settings because the email is address is dynamicaly enter by the participant through the online form.

So I'd rather do this with the hook.

My question is : I have defined a new field WITHOUT using the custom data/profile but directly from the template ; but can I propagate this field through the registration process?

Many thanks one more time

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Hook to handle additionnals actions after online form submit
July 17, 2011, 01:49:17 pm

You will need to save the POST value if you have just modified the template

a better option might be to use the hooks to add a form element, in which case civicrm automatically saves and persists the value

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Hook to handle additionnals actions after online form submit

This forum was archived on 2017-11-26.