I have a boolean field called verified defined in profile2. When this field changes from not ticked to ticked I would like to send out an email to the user. Easy I thought with rules
Starting using "After updating an existing profile" then comparing the fields
profile2-unchanged:user:profile-directory-information:field-verified
and
profile2:user:profile-directory-information:field-verified
(bascially saying equal and then negating the condition)
"IF" : [
{ "user_has_role" : {
"account" : [ "profile2:user" ],
"roles" : { "value" : { "12" : "12" } }
}
},
{ "user_has_role" : {
"account" : [ "site:current-user" ],
"roles" : { "value" : { "3" : "3", "28" : "28" } },
"operation" : "OR"
}
},
{ "NOT data_is" : {
"data" : [ "profile2-unchanged:user:profile-directory-information:field-verified" ],
"value" : [ "profile2:user:profile-directory-information:field-verified" ]
}
}
],
However they are always the same value and the rule never fires. However when I take out the condition and send myself an email with the two values. One is true the other one is false.
also tried this in the condition:
{ "data_is" : {
"data" : [ "profile2-unchanged:user:profile-directory-information:field-verified" ],
"value" : 0
}
},
{ "data_is" : {
"data" : [ "profile2:user:profile-directory-information:field-verified" ],
"value" : 1
}
}
which is also not working. Tried to move it in before saving a profile, and also in various save user events. Always the same result. So why are the values different in Actions then they are in conditions?
Am I missing something here?