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)

Supporting organizations: 
Development

Project information

Releases