I have a site set up using a Drupal rule to create a new user account when a new membership is created.

The new account creation triggers a Drupal welcome e-mail to the user, as defined in the Drupal Account Settings, so it's populated using Drupal variables, e.g. 'Dear [user:name]'.

I'm using e-mail addresses for Drupal usernames, but I don't especially want our welcome e-mails to be addressed using only e-mail address. Is there a way to use CiviCRM tokens in Drupal welcome e-mails, so I can address them by name from the contact record?

Even better, most of our individual users inherit their membership from an organisation. If the above is possible, is there also way to use a CiviCRM token to refer to the primary membership? So, for example, I could write something along the lines of, 'An account has been created for you because of your volunteer role with [parent organisation]'?

  • Did you ever come up with a solution for this?
    – Rob Brandt
    Dec 8, 2020 at 19:15
  • Nothing easy to use enough that I've managed it, but I'm sure suggestions here might be worth a go. Dec 11, 2020 at 15:00

2 Answers 2


You might be able to do something with Drupal Entities and Drupal Tokens. You would replace the default welcome emails with one created by rules. CiviCRM Tokens are used exclusively within CiviCRM.



If you use Fuzion's CiviToken, you can get the Drupal username and user ID from within CiviCRM.

You might then be able to create a custom token for use with CiviToken to generate a one-time login URL as a token in some way (user_pass_reset_url?) Use the CiviToken examples and put your custom token in custom_php/tokens. (You could also make a custom token to pull the organization name.)

Then you could turn off the Drupal notifications for new accounts and just include these tokens in an email from CiviCRM for new memberships.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.