Skip to main content

email_link

Outputs either a clickable mailto: link (if the user is currently logged in), or an obfuscated email (if the user is not logged in). The intent of this is to be a spammer-safe way to link to email addresses.

Parameters

input (String)

An email address

Returns (String)

A spammer-safe HTML representation of the email address

Examples

When logged in
{{ "test@example.com" | email_link }}
=> <a href="mailto:test@example.com">test@example.com</a>
When not logged in
{{ "test@example.com" | email_link }}
=> test AT example DOT com