Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

E-mail Field Formatter

Security covered Under active development 132 sites

This module provides a formatter for email fields, allowing you to display email addresses as clickable mailto links. It also supports truncating long addresses with an ellipsis, prepending custom text or HTML, and adding Font Awesome icons.

The E-mail Formatter module is a field formatter for the Email field (in Drupal
8 core) to allow email field addresses to be:

  • rendered with mailto: links
  • truncated to a specified number of characters for rendering, and if
    truncated then ended with an ellipsis (…)
  • preceded by
    • custom text
    • custom HTML
    • an appropriate Font Awesome icon, which can also be rendered as a mailto: link to the address

Requirements

The Drupal 8+ core field module using the e-mail format is required, obviously,
and if the icons option is used, then the Font Awesome Icons module (8.x-2.x) that adds the FA project to Drupal allowing the icons to be displayed will be needed too.

If you're using it, don't forget to add/upgrade to the latest version of Font Awesome via your /admin/config/content/fontawesome settings.

Installation

Install as you would normally install a contributed drupal module.

Configuration

Just head to a content type display management tab (ex. http://yoursite.com/admin/structure/types/manage/yourtype/display) where you have an email field/fields. In the format column for the email field that you want to use this formatter, select the 'E-mail formatter (with options)' format, and save the form to put it into use.

Click the settings cog/gear button to view and edit the (hopefully) self-explanatory options for how the links should be displayed.

To customise the output further, just theme your pages as usual.

Troubleshooting

Try clearing all your caches using the performance configuration page should you encounter any issues.

Edit the settings for the problematic field, using the cog/gear button, to flush out any invalid settings from previous versions of this module.

Don't forget to add/upgrade to the latest version of Font Awesome via your /admin/config/content/fontawesome settings.

Future plans

Support Twig templating of the output.

Thanks

The icons are from the Font Awesome project, by Greg Loucas and Dave Gandy.

The font has been made available to Drupal in the Font Awesome Icons module by Rob
Loach (RobLoach)
and Inder Singh (inders)

Ask your assistant about E-mail Field Formatter

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

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Apr 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
2.0.0-rc3 Pre-release 8–11 Apr 1, 2024