URL redirect for first time users

Events happening in the community are now at Drupal community events on www.drupal.org.
nflowers1228's picture

I need to create a rule that redirects users to their user account edit page if the email field is blank. I have gotten it to work with the redirect, the part I'm having a problem with is having this only show up is the email field is blank. Here is what I put in the Execute Custom PHP Code field:

<?php
return ($account->[account:mail] == 0);
?>

I looked at this video: http://www.slurpitup.com/drupal/redirect-user-using-rules-based-on-a-pro..., but using the Truth statement didn't work. So I thought I could just put the code in the PHP area. Any thoughts?

Comments

I don't think the replacement

sgorneau's picture

I don't think the replacement tokens will work in the scope of PHP. I would use the $account object itself like this

return $account->mail == '';

Shaun

Sorry

sgorneau's picture

Edited my comment above...the PHP tags should not be included in the Rule PHP code.

That works! thanks!

nflowers1228's picture

That works! thanks!

Nancy Flowers-Mangs

Connecticut

Group categories

County or Region

Event Type

Featured Item (Admin Only)

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: