Support

Home Forums Event Espresso Premium Register on behalf of another user

Register on behalf of another user

Posted: July 31, 2013 at 3:50 pm

Viewing 1 reply thread


Brant LeClercq

July 31, 2013 at 3:50 pm

Hi Guys,

I was wondering if there is an option to register for an event on behalf of another user. Ideally what I’d like to do is have the option to sign up for an event putting in an email address to receive the invoice and the personal information for another user to receive the venue information. I have tried adding custom question groups but have not been able to collect the information I require without adding an extra attendee.

For example, ‘Sean’ is paying for an event on behalf of his company. If he buys tickets for two of his employees(but not himself) id like to have the option to get Sean’s email, as well as the two employee email address. From there id like to send just the invoice to Sean, and the venue information to his employees. Is this possible?

Thanks.


Sidney Harrell

July 31, 2013 at 8:43 pm

Not without a little bit of hackery. Ready?
Copy the folder gateways/invoice into uploads/espresso/gateways. That way you will keep your modifications after you update EE. Open the file invoice_vars.php and go to line 25 and add the line:

event_espresso_send_payment_notification(array('attendee_id' => $payment_data['attendee_id'], 'registration_id' => $payment_data['registration_id']));

That will send the payment notification email (which you’ll want to customize under EE’s general settings to add the invoice link, etc). Next you’ll want to pull up the answer to your custom question “Employee’s email address”. This is where it gets a little hacky, because you’ll need to know the question id for that question in advance. Go to the questions in the admin and click on your custom question like you are going to edit it. When it loads up, in the url in the address bar of your browser, at the end, you’ll see “question_id=” and then a number. I’m going to put the number 42 in my code, but you’ll want to replace that with your actual question id.

global $wpdb;
	$sql = "SELECT answer FROM " . EVENTS_ANSWER_TABLE . " WHERE attendee_id=%d AND question_id=42";
	$employee_email = $wpdb->get_var($wpdb->prepare($sql, $attendee_id));
	$data = espresso_prepare_email_data($attendee_id, FALSE, '');
	$data->attendee->email = $employee_email;
	$email_params = espresso_prepare_email($data);
	event_espresso_send_email($email_params);
	$email_params = espresso_prepare_admin_email($data);
	event_espresso_send_email($email_params);

Note that this only changes the “To:” of the confirmation email to be the answer to your custom question. All the other data in the confirmation email is from the answers to the questions (first and last name, etc). So you’ll probably want to customize the confirmation email, either in the general settings or on a per event basis.

Viewing 1 reply thread

The support post ‘Register on behalf of another user’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso