I essentially need to create a RedHen contact after an anonymous user completes a registration form.

I just need to pass values submitted upon registration to the new RedHen Contact fields such as First/Last name and Email address. Here's what I have so far:

{ "rules_new_registration_creates_redhen_contact" : {
    "LABEL" : "new registration creates redhen contact",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "registration" ],
    "ON" : [ "registration_insert" ],
    "IF" : [
      { "entity_has_field" : { "entity" : [ "registration:entity" ], "field" : "field_first_name" } },
      { "AND" : [] },
      { "entity_has_field" : { "entity" : [ "registration:entity" ], "field" : "field_last_name" } }
    ],
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "redhen_contact",
            "param_type" : "choir_registrant",
            "param_first_name" : "[registration:field-first-name]",
            "param_last_name" : "[registration:field-last-name]",
            "param_redhen_state" : "1"
          },
          "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
        }
      },
      { "entity_save" : { "data" : [ "entity-created:relation-redhen-connection-redhen-contact:0" ] } }
    ]
  }
}

I know I'm way off here and not sure as to how I should proceed past this point. Any hints, tips or tricks would be greatly appreciated.

Comments

bubu’s picture

bubu’s picture

Think you can close this issue to, similar to #2008910: Add permission and ability to "create own redhen contact"

levelos’s picture

Status: Active » Closed (duplicate)