Quantcast
Channel: Rule to create a Linked Drupal user account for a specific CiviCRM Contact Subtype - CiviCRM Stack Exchange
Viewing all articles
Browse latest Browse all 2

Rule to create a Linked Drupal user account for a specific CiviCRM Contact Subtype

$
0
0

I’m using Drupal 7.56, the Rules module 7.x-2.11 and CiviCRM 4.6.31.

I'm trying to create a Drupal Rule that checks the subtype of contact to create a Linked Drupal User Account just for a specific subtype of CiviCRM contacts when they submit a Membership Signup form.

I need to trigger that rule when a "CiviCRM Membership has been created", as Drupal needs an email to create the user account. If I include the Event "CiviCRM contact has been created" instead of "CiviCRM Membership has been created" to trigger the rule evaluation, the email for the contact is not available yet on the database, as e-mail address is an independent entity in CiviCRM and created after the contact has been created, so the rule fails when trying to create the Drupal user account.

The condition "CiviCRM Contact is of subtype" only works if I make the CiviCRM contact available from the "CiviCRM contact has been created" Event. So when I have the Event "CiviCRM Membership has been created", required for my rule to work, the CiviCRM Contact accessible from this Entity/Event (CiviCRM Membership) doesn't work with the condition "CiviCRM Contact is of subtype", as the Contact Subtype is an Array:

... (Array, 1 element)

 0 (String, 6 characters) Parent

Is there any way to make CiviCRM Contact Entity accessible from two different Events that trigger the rule evaluation, as "CiviCRM Membership has been created" and "CiviCRM contact has been created", so that the condition "CiviCRM Contact is of subtype" can have the appropriate CiviCRM contact parameter?

Or if it's not possible, how can I access the Array variable? I know I have to use the Rules Condition List contains item, but I'm not able to make "Contact Subtype" Array variable available to evaluate the Condition.

Any help will be very much appreciated.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images