I would like to make a rule to send an email with users details when they register. The email should be conditional on the user filling out certain profile information. I checked the conditions and it doesn't look like there is a method check that a profile field contains a certain value. Then I also check and event there is a new user is created trigger there does not seem to be a corresponding action that will allow me to load the newly created users information and send an email with that info to an arbitrary email address.

Comments

osopolar’s picture

Version: 6.x-1.0-beta5 » 6.x-1.x-dev
Component: User Interface » User interface

I need something similar. At the moment I can send a mail with the Token replacement patterns.

But I cant use my profile variables:
[account:profile_rolle]
[account:profile_info]

yesct’s picture

I'm interested in this too. I'm using the content profile module to have a cck content type node filled out and cck fields in the profile

yesct’s picture

I got a part (changes to an already existing profile) of what I was interested in working. I made a video of it, if that helps anyone else: http://cathytheys.blip.tv/file/2022133 There is likely a more elegant way, but this was good for my first try!

yesct’s picture

ositoblanco, was that typo rolle instead of role effecting things?

osopolar’s picture

Thank's for this hint, but rolle is just the german word for role.

For user registration there are only [account:...] and [user:...] tokens ... no [node:...] tokens.

fago’s picture

That sounds like a nice use case. Perhaps you can share your rule http://drupal.org/node/298483?
Probably best the shared rule would only contain tokens existing per default .

mitchell’s picture

Status: Active » Fixed

this one seems well taken care of.

deverman’s picture

I am still not clear on it and I can't access blip.tv from China to watch the video.

mitchell’s picture

@deverman: what?

deverman’s picture

@mitchell

I cannot access this link: http://cathytheys.blip.tv/file/2022133

I now realized that this user information is available:

[account:user] User's name
[account:user-raw] User's unfiltered name. WARNING - raw user input.
[account:uid] User's ID
[account:mail] User's email address
[account:reg-date] User's registration date
[account:reg-since] Days since the user registered
[account:log-date] User's last login date
[account:log-since] Days since the user's last login
[account:date-in-tz] The current date in the user's timezone
[account:account-url] The URL of the user's profile page.
[account:account-edit] The URL the user's account editing page.

What about profile fields can I access those?

daniel wentsch’s picture

@YesCT: thanks for your screencast. It almost helps me solving my problems. Only one problem remains, maybe you can help? I don't have those "Token replacement patterns" availble on my action editing screen. Did you do anything special apart from installing token module? Token is working fine, for example in conjunction with pathauto, but here it just doesn't show up. Anything I forgot?

Thank in advance,
Daniel

mitchell’s picture

@deverman, wentsch: This issue is fixed. Please open a new one if you have additional questions.

@wentsch: you need the dev version of token.

osopolar’s picture

Status: Fixed » Needs work

Hi, I forgot to leave a node here: I have shared the rule here: http://drupal.org/node/454436.

@mitchell: To me it doesn't seem that this Issue is fixed anyway, because deverman said:

The email should be conditional on the user filling out certain profile information. I checked the conditions and it doesn't look like there is a method check that a profile field contains a certain value.

I hope you don't mind if I reopen it to get a solution. Maybe the easiest solution is, that there is no way to get the profile informations (profile fields are these provided by the profile module, not the standard fields which deverman has listed in #10).

osopolar’s picture

Status: Needs work » Closed (fixed)

I'm pretty sure, that at the moment its not possible to include the profile fields. I think this is related to the issue: #125640: Profile tokens.

So we just have to wait / help out on token module until the mentioned feature request gets fixed.

deverman’s picture

yes I was also looking for conditional support on profile values as I want to send emails only if the user has indicated they want to receive them in their profile.

quentinsf’s picture

Just for those coming across this in future - you might find this thread helpful:

http://groups.drupal.org/node/79754

carefulMEDIA’s picture

@YesCT I don't know if you've moved along in only sending the changed fields. I did it with a series of if statements like this:
if ($node->field_telephone_bureau[0]['value'] != $node_unchanged->field_telephone_bureau[0]['value']):
Téléphone bureau: [node:field_telephone_bureau-formatted]
endif;
etc.
Hope this helps!

JelleC’s picture

I found a solution for adding additional profile fields to the rules email template. Maybe this can help someone.
Steps i followed:

1. first of all I added the field "phone" to the users profile
2. Then I created a rule. in my case I send an email to all users of a specific role when a user adds some content
3. You can print the field "phone" of the user in the email template by adding this php snippet to the message area (rules >> triggered rules >> overview >> created rule in step 2) print $user->profile_phone;