Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Users Birthday Block

Security covered Under active development 2 sites

This module creates a block and a page that show upcoming user birthdays. It also adds fields for "Date of Birth" and "First Name" to user profiles.

Introduction

Birthday Block shows your site's users whose birthdays are today or coming up soon — in a block you can place
anywhere, and on a full birthdays page. On install it adds Date of Birth and First Name
fields to user accounts and puts them on the user form, so people can fill them in straight away.

It can also email each user a personalised greeting on their birthday, sent automatically on cron and never more
than once a year.

Project Summary

Celebrate your team or community: show today's and upcoming user birthdays in a configurable block and page, and
send every user an automatic birthday email.

Features

  • A Birthday Block with per-block settings: how many days ahead to look, how many upcoming birthdays to list, custom headings, the user picture and its image style, the age the user turns, and a View all link to the full page.
  • A birthdays page at /user/birthday with a configurable title and date range, listing today's birthdays first and then upcoming ones in date order.
  • Automatic birthday greeting emails, sent on cron at most once per user per year, with an editable subject and body that support tokens such as [user:display-name] and [site:name]. Emails are off until you turn them on.
  • Date of Birth and First Name fields created on install and shown on the user form and profile. The profile shows only the day and month, so users' ages are not made public. Users without a first name are listed by their display name.
  • Only active users are listed. Profile links are shown only to visitors who may view user profiles.
  • Users born on 29 February are listed on 28 February in non-leap years.
  • Works on any database Drupal supports. Birthdays are calculated in the site's default timezone.
  • Cache-friendly: listings are cached until midnight and refreshed when a user is updated or the date changes, including for anonymous visitors served from the page cache.

Post-Installation

After installing the module:

  1. Ask users to fill in their Date of Birth and First Name on their account edit form. Both fields are added to the user form and profile automatically.
  2. Grant the View user birthdays permission to the roles that should see birthdays. Authenticated users get it on install.
  3. Go to Structure → Block layout and place the Birthday Block in a region. Adjust its settings to choose how far ahead to look and what to display.
  4. Go to Configuration → People → Birthday settings (/admin/config/people/birthday) to set the birthdays page title and range, and to turn on and edit the birthday greeting email.
  5. If you turn on greeting emails, make sure cron runs at least once a day and that your site can send email.

Additional Requirements

  • Drupal 10.3+ or 11
  • Core modules: User, Datetime and Image

No contributed modules or external libraries are required.

Similar projects

Birthdays provides its own birthday field type with views
integration and blocks. Birthday Block is deliberately simpler: it works with a standard core date field on the user
account, sets everything up on install, and covers the common case — a block, a page and a greeting email —
with no Views configuration needed.

Supporting this Module

Bug reports, feature requests, patches, and documentation improvements are welcome through the Drupal.org issue
queue.

Community Documentation

Documentation is available in the project repository's README, including block and email configuration.

Upgrading

Run drush updb after updating. The update grants the new View user birthdays permission
to every role that had access content, so existing sites keep the same visibility, adds the default
settings, and shows the birthday fields on the user form and profile. Themes that override the module's templates
need updating: the item template now receives name, url, picture,
date, age and is_today instead of content.

Permissions

  • View user birthdays – see the Birthday Block and the birthdays page, which show user names and birth dates.
  • Administer birthday block (restricted) – manage the birthdays page settings and the birthday greeting email.

Architecture

  • BirthdayManager – the shared service that finds active users with a birthday in a date range, works out the date and age, builds each birthday's render array, and provides the cache settings. Used by the block, the page and the mailer alike.
  • BirthdayMailer – sends today's greeting emails on cron, replacing tokens in the subject and body, and remembers who has been greeted so each user gets one email per year.
  • BirthdayBlock – the configurable block plugin.
  • BirthdayController – the birthdays page at /user/birthday.
  • BirthdaySettingsForm – the settings screen for the page and the greeting email.
  • Templates – birthday-block.html.twig, birthday-list.html.twig and birthday-block-item.html.twig, all overridable from a theme.

The module is fully compatible with Drupal 11.

Drupal 10–11

Ask your assistant about Users Birthday Block

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • datetime Drupal core
  • image Drupal core
  • user Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Aug 2024
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.5 Stable 10–11 Oct 12, 2026
1.0.4 Stable 10–11 Oct 9, 2026
1.0.3 Stable 10–11 Sep 24, 2024
1.0.2 Stable 10–11 Aug 9, 2024
1.0.1 Stable 10–11 Aug 8, 2024
1.0.0 Stable 10–11 Aug 8, 2024