Created
June 14, 2013 16:13
-
-
Save mrconnerton/5783188 to your computer and use it in GitHub Desktop.
cod create user rule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "rules_cod_create_user_registration" : { | |
"LABEL" : "cod_create_user_registration", | |
"PLUGIN" : "reaction rule", | |
"ACTIVE" : false, | |
"TAGS" : [ "cod" ], | |
"REQUIRES" : [ "rules", "commerce", "registration" ], | |
"ON" : [ "registration_insert" ], | |
"IF" : [ | |
{ "AND" : [ | |
{ "NOT data_is_empty" : { "data" : [ "registration:anon-mail" ] } }, | |
{ "NOT entity_exists" : { | |
"type" : "user", | |
"property" : "mail", | |
"value" : "[registration:anon-mail]" | |
} | |
} | |
] | |
} | |
], | |
"DO" : [ | |
{ "entity_create" : { | |
"USING" : { | |
"type" : "user", | |
"param_name" : "[registration:field-profile-first] [registration:field-profile-last]", | |
"param_mail" : [ "registration:anon-mail" ] | |
}, | |
"PROVIDE" : { "entity_created" : { "new_user" : "New User" } } | |
} | |
}, | |
{ "data_set" : { "data" : [ "new-user:status" ], "value" : "1" } }, | |
{ "data_set" : { | |
"data" : [ "new-user:field-profile-first" ], | |
"value" : "[registration:field-profile-first]" | |
} | |
}, | |
{ "data_set" : { | |
"data" : [ "new-user:field-profile-last" ], | |
"value" : "[registration:field-profile-last]" | |
} | |
}, | |
{ "entity_save" : { "data" : [ "new-user" ], "immediate" : 1 } } | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment