Is it possible to send an invitation programatically? I couldn't find an obvious way to do this in the code. Thanks.

Comments

areynolds’s picture

From a cursory glance, it seems that there isn't a single function you could use to create an invite. I need to send invites programatically, so hopefully I come up with some solution, but until then, has anyone else tackled the problem in the last two years?

rimu’s picture

Issue summary: View changes

In the 7.x-4.x version of this module it's all about entities. You can create a new invitation (with email) by doing something like this

$invite = entity_create('invite', array('type' => 'invite_by_email'));

$invite->field_invitation_email_address['und'][0]['value'] = 'whatever@gmail.com';
$invite->field_invitation_email_subject['und'][0]['value'] = '[invite:inviter:name] has invited you to a meeting';
$invite->field_invitation_email_body['und'] = array();

invite_save($invite);

renatog’s picture

Very good @rimu.

Your answer can help many users.

Thank you very much.

renatog’s picture

renatog’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.