Skip to content

Send email on user registration with field values

Version

You can apply this model as a recipe (Drupal 10.3 or later) to your own Drupal site:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Import recipe
composer require drupal-eca-recipe/eca_lib_0025

# Apply recipe with Drush (requires version 13 or later):
drush recipe ../recipes/eca_lib_0025

# Apply recipe without Drush:
cd web && php core/scripts/drupal recipe ../recipes/eca_lib_0025

# Rebuilding caches is optional, sometimes required:
drush cr

Purpose

This model sends an email to a user that has just registered on the site. That email contains field values, that the user just provided in the registration form, where one of the fields is mandatory and the other one is optional. The email message is different, depending upon the optional field being filled or not.

The creation of this model was recorded and can be watched here.

Dependencies

  • config
    • field.field.user.user.field_country
    • field.field.user.user.field_home_town
    • field.storage.user.field_country
    • field.storage.user.field_home_town
  • module
    • eca_base
    • eca_content
    • user

Used plugins

Events

Conditions

Actions