Answers.Body: <p>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.</p>
  
  <p>-Josh</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-05T04:33:23.500Z
Answers.LastActivityDate: 2019-08-05T04:33:23.500Z
Answers.UserDisplayName: Josh
Answers.Body: <p>You can use <a href="https://www.drupal.org/sandbox/guanhuan/2356699" rel="nofollow noreferrer">CiviCRM Token module</a>, still in sandbox/development, but it should work.
  For D8, I've converted this module and it's available at: <a href="https://github.com/drupal-modules/civicrm_token" rel="nofollow noreferrer">GitHub</a>.</p>
  <p>List of tokens which can support:</p>
  <pre><code>CiviCRM civi    Tokens related to CiviCRM.
  Contact Dashboard   [civi:contact_dashboard]    CiviCRM contact dashborad of current user.
  Contact Email   [civi:contact_email]    CiviCRM contact email of current user.
  Contact First Name  [civi:contact_first_name]   CiviCRM contact first name of current user.
  Contact ID  [civi:contact_ID]   CiviCRM contact ID of current user.
  Contact Last Name   [civi:contact_last_name]    CiviCRM contact last name of current user.
  Contact Phone Number    [civi:contact_telephone]    CiviCRM contact telephone number of current user.
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-19T17:10:31.530Z
Answers.LastActivityDate: 2023-04-19T17:10:31.530Z
Answers.UserDisplayName: kenorb
Answers.Body: <p>You could perhaps sidestep Drupal and</p>
  <ul>
  <li>use CMS User extension to create the Drupal User. this then has the option of using or not using Drupal 'welcome email', therefore do not use it</li>
  <li>use CiviRules to send out the welcome email instead (and perhaps that means you have to just include the link to pw reset rather than include a one-time login as drupal would)</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-19T20:55:43.533Z
Answers.LastActivityDate: 2023-04-19T20:55:43.533Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>If you use <a href="https://civicrm.org/extensions/nzcofuzioncivitoken" rel="nofollow noreferrer">Fuzion's CiviToken</a>, you can get the Drupal username and user ID from within CiviCRM.</p>
  
  <p>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 (<a href="https://api.drupal.org/api/drupal/modules%21user%21user.module/function/user_pass_reset_url/7.x" rel="nofollow noreferrer">user_pass_reset_url</a>?) Use the <a href="https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken/tree/master/tokens" rel="nofollow noreferrer">CiviToken examples</a> and put your custom token in <code>custom_php/tokens</code>. (You could also make a custom token to pull the organization name.)</p>
  
  <p>Then you could turn off the Drupal notifications for new accounts and just include these tokens in an email from CiviCRM for new memberships. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-05T15:29:10.900Z
Answers.LastActivityDate: 2019-08-05T15:29:10.900Z
Answers.UserDisplayName: Laryn
Body: <p>I have a site set up using a Drupal rule to create a new user account when a new membership is created.</p>
  
  <p>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]'.</p>
  
  <p>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?</p>
  
  <p>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]'?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-08T19:15:45.330Z
Comments.Text: Did you ever come up with a solution for this?
Comments.UserDisplayName: Rob Brandt
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-11T15:00:51.380Z
Comments.Text: Nothing easy to use enough that I've managed it, but I'm sure suggestions here might be worth a go.
Comments.UserDisplayName: somnolentsurfer
Tags: <drupal><tokens><user-account>
Title: Use CiviCRM tokens in Drupal welcome e-mails?
ThreadText: # Use CiviCRM tokens in Drupal welcome e-mails?
  
  (Asked by: username_0 on 2019-07-26)
  
  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]'?
  
  **Tags:** drupal, tokens, user-account
  
  > **Comments:**
  > **username_1**: Did you ever come up with a solution for this?  
  > **username_0**: Nothing easy to use enough that I've managed it, but I'm sure suggestions here might be worth a go.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_2 on 2019-08-05. Score: 1
  
  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.
  
  -username_2
  
  
  ---
  
  ### Answer by username_3 on 2023-04-19. Score: 1
  
  You can use CiviCRM Token module, still in sandbox/development, but it should work.
  For D8, I've converted this module and it's available at: GitHub.
  List of tokens which can support:
  CiviCRM civi    Tokens related to CiviCRM.
  Contact Dashboard   [civi:contact_dashboard]    CiviCRM contact dashborad of current user.
  Contact Email   [civi:contact_email]    CiviCRM contact email of current user.
  Contact First Name  [civi:contact_first_name]   CiviCRM contact first name of current user.
  Contact ID  [civi:contact_ID]   CiviCRM contact ID of current user.
  Contact Last Name   [civi:contact_last_name]    CiviCRM contact last name of current user.
  Contact Phone Number    [civi:contact_telephone]    CiviCRM contact telephone number of current user.
  
  
  ---
  
  ### Answer by username_4 on 2023-04-19. Score: 0
  
  You could perhaps sidestep Drupal and
  
  * use CMS User extension to create the Drupal User. this then has the option of using or not using Drupal 'welcome email', therefore do not use it
  * use CiviRules to send out the welcome email instead (and perhaps that means you have to just include the link to pw reset rather than include a one-time login as drupal would)
  
  
  ---
  
  ### Answer by username_5 on 2019-08-05. Score: 0
  
  If you use [Fuzion's CiviToken](https://civicrm.org/extensions/nzcofuzioncivitoken), 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](https://api.drupal.org/api/drupal/modules%21user%21user.module/function/user_pass_reset_url/7.x)?) Use the [CiviToken examples](https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken/tree/master/tokens) 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.
  
  
  ---
  
  