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
Comment #1
osopolarI 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]
Comment #2
yesct commentedI'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
Comment #3
yesct commentedI 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!
Comment #4
yesct commentedositoblanco, was that typo rolle instead of role effecting things?
Comment #5
osopolarThank'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.
Comment #6
fagoThat 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 .
Comment #7
mitchell commentedthis one seems well taken care of.
Comment #8
deverman commentedI am still not clear on it and I can't access blip.tv from China to watch the video.
Comment #9
mitchell commented@deverman: what?
Comment #10
deverman commented@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?
Comment #11
daniel wentsch commented@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
Comment #12
mitchell commented@deverman, wentsch: This issue is fixed. Please open a new one if you have additional questions.
@wentsch: you need the dev version of token.
Comment #13
osopolarHi, 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:
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).
Comment #14
osopolarI'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.
Comment #15
deverman commentedyes 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.
Comment #16
quentinsf commentedJust for those coming across this in future - you might find this thread helpful:
http://groups.drupal.org/node/79754
Comment #17
carefulMEDIA commented@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!
Comment #18
JelleC commentedI 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;