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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Multiple on line registration: how to get all contact_ids in confirmation mail
Pages: [1]

Author Topic: Multiple on line registration: how to get all contact_ids in confirmation mail  (Read 474 times)

pjaaar

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Joomla 1.6.6
  • MySQL version: 3.23
  • PHP version: 5.4
Multiple on line registration: how to get all contact_ids in confirmation mail
August 28, 2012, 12:24:38 am
Hi guys,

I have an online form for registration of events.

When a user saves several participants, I would like to display in the confirmation email one barcode for each participant. I wish there was the "contact_id" value in this barcode.

I have no problem to generate the barcodes but I do not know how to display "contact_id" for each participant ... I think that this is possible because I'm still aware of the number of participants, I have all their profiles, etc..

My track for the mment (oh I forgot: I can only register two participants: the user and his invite):

I modify the following hook to set the nickname token to the contact_id of the user invite participant:

    static function tokenValues( &$details,
                                 $contactIDs,
                                 $jobID = null,
                                 $tokens = array( ),
                                 $className = null ) {
                        
      foreach($contactIDs as $id) {
         $query = "SELECT contact_id FROM civicrm_participant WHERE event_id = 'xxx' AND registered_by_id = (SELECT id FROM civicrm_participant WHERE contact_id = $id AND event_id = 'xxx')";
         $dao = CRM_Core_DAO::executeQuery($query);
         while ( $dao->fetch( ) ) {
            $value['contact.nickname'] = $dao->contact_id;
         }
      }
    }


But nothing appears in my confirmation mail.

Thank you in advance and sorry for my bad english,

pj.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Multiple on line registration: how to get all contact_ids in confirmation mail
August 28, 2012, 11:23:22 pm
Did you try your SQL caluse separately in phpmyadmin or some other tool?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Multiple on line registration: how to get all contact_ids in confirmation mail

This forum was archived on 2017-11-26.