Fill Address/Phone enityRef
I'd suggest you create 2 custom fields for this in the activity (pickup location &amp; contact phone number). You can then use a bit of javascript to insert the contact's email &amp; phone into those fields and it will come through in the activity email. As an added bonus, this approach gives the flexibility of allowing the user to override those defaults if the person needs to be picked up elsewhere.

To do this, your buildform hook needs to do 2 things:


Request the extra address/phone info from the target_contact_id field. You can do:

$form-&gt;_fields['target_contact_id']['attributes']['api']['extra'] = array(
  'street_address',
  'city',
  'state_province',
  'postal_code',
  'phone',
);

Add your javascript to the form using CRM_Core_Resources (hint: create a js file in your extension, and use CRM_Core_Resources::singleton()-&gt;addScriptFile('myExtension', 'js/myScript.js'))


Your javascript can then use some basic jQuery like:

CRM.$(function($) {
  $('#target_contact_id').change(function() {
    if ($(this).val()) {
      // This contains the extra fields you requested
      var data = $(this).select2('data')[0].extra;
      // For example, populate a custom field with the phone
      $('#custom_42').val(data.phone);
    }
  });
});


You can read more about javascript in CiviCRM here.