How to Customize the Welcome Email in Drupal 8

How to Customize the Welcome Email in Drupal 8

Introduction: Configuring a New Drupal 8 Website.

This Tutorial will show Drupal administrators how to customize the “Welcome” email text that is sent out to registered users via email during the sign-up process.

  • Problem: When new users register, they receive a welcome email that needs more information about business services, website policies, & account management.
  • Solution: Navigate to Drupal 8 Administration & re-write the email text for new users with system PHP & MySQL database variables. Save the new settings.

With this solution, business owners can include more information about their services in emails and websites can customize their welcome message to new users. Let’s get started.

Step One:
Confirm User Management & Role Settings.

In the first step, we will confirm the Role settings on a new Drupal 8 website by navigating to: /admin/people and then clicking on the Roles tab.

The default Drupal 8 configuration is for three roles: Anonymous User, Authenticated User, & Administrator.

This tutorial will review the settings for creating a custom email for the Authenticated User role.

After a new user registers, he/she will receive a welcome email from the website with a signed message from the business or publishers.

Businesses need to edit this information in order to include more pertinent details on account management and specific links to website policies.

Welcome emails can also promote ecommerce listings and different products. Administrators can build templates with HTML & system PHP variables.

Step Two:
Review the Welcome Email Configuration.

Review the Site Details settings at: /admin/config/system/site-information

Make sure to change your Site Name to how it will appear in the welcome emails.

Next navigate to /admin/config/people/accounts to review the Registration & Cancellation settings for the Drupal 8 website.

Change the settings to permit Visitors to register without administrator approval.

In the Email section:

Change the email title and text according to the requirements of the website.

[user:display-name],
A site administrator at [site:name] has created an account for you. You may now log in by clicking this link or copying and pasting it into your browser:
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able tologinat [site:login-url] in the future using:
username: [user:name]
password: Your password
--  [site:name] team

For new users, the email text will be different depending on whether the account needs to have administrator approval or not. Administrators can also change the account activation email text:

[user:display-name],
Your account at [site:name] has been activated.
You may now log in by clicking this link or copying and pasting it into your browser:
[user:one-time-login-url]
This link can only be used once to log in and will lead you to a page where you can set your password.
After setting your password, you will be able tologinat [site:login-url] in the future using:
username: [user:account-name]
password: Your password

Note: Drupal 8 has options for using available system PHP variables available through Tokens.

Step Three:
Add System PHP Variables to Email Text.

The available system PHP Variables available for the email text settings are:

[site:name], [site:url], [user:display-name], [user:account-name], [user:mail], [site:login-url], [site:url-brief], [user:edit-url], [user:one-time-login-url], [user:cancel-url]

These may vary & increase depending on what other modules are installed in your Drupal 8 CMS locally. Include the PHP variable tokens for referencing Drupal 8 user information.

Step Four (Optional):
Add HTML Mail Support.

To give even more options in customizing the welcome emails in Drupal 8, administrators can install the HTML Mail module

Prerequisites: In order to install HTML Mail module, first you will need to install the Mail System & Pathologic modules.

After enabling these modules in Drupal 8, install & enable the HTML Mail module.

Hint: Drupal web developers can use the Token module to have access to more PHP variables from other modules in emails.

Echo wraps your messages in a Drupal theme so that you can send branded HTML5 emails with the same logo, header, fonts, & styles as your website.

Conclusion: HTML Mail & Token for Advanced Features.

The HTML Mail module gives Drupal 8 site administrators the options to create custom welcome email templates for users with site information, account management links, & ecommerce promotions.

Summary: Use Token for even more access to PHP variables from Drupal 8 modules.

Topics:Drupal 8, User Management, Email, CRM, Web Security
Level:Newbie

Time:10 minutes

Check out these top 3 Drupal hosting services:

Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
Hostinger
$2.99 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
    4.7
  • Support
    4.7
  • Features
    4.8
  • Reliability
    4.8
  • Pricing
    4.7
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
  • Want to get top recommendations about best hosting? Just click this link!

How to Optimize or Repair a Drupal Database

This Tutorial will show how to optimize a MySQL database for better performance
3 min read
Jeffrey Scott
Jeffrey Scott
Hosting Expert

How to Manage User Permissions for Roles in Drupal 8

This Tutorial will show how to create new User Roles for Drupal 8 and to edit Us
3 min read
Jeffrey Scott
Jeffrey Scott
Hosting Expert

How to Upgrade a Drupal 7 Site to Drupal 8

This Tutorial will show users the recommended steps to take when upgrading a Dru
6 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Configure an Email Client from cPanel in Shared Web Hosting

This how-to shows you how to configure email clients within cPanel for a shared
3 min read
Bruno Mirchevski
Bruno Mirchevski
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top