Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
bubuSimilar: #2008910: Add permission and ability to "create own redhen contact"
Comment #2
bubuThink you can close this issue to, similar to #2008910: Add permission and ability to "create own redhen contact"
Comment #3
levelos CreditAttribution: levelos commented