Link.email ViewHelper <f:link.email>
Email link ViewHelper. Generates an email link incorporating TYPO3s spamProtectEmailAddresses TypoScript setting.
Examples
Basic email link
<f:link.email email="foo@bar.tld" />
Copied!
Output:
<a href="#" data-mailto-token="ocknvq,hqqBdct0vnf" data-mailto-vector="1">foo(at)bar.tld</a>
Copied!
Depending on spamProtectEmailAddresses setting.
Email link with custom linktext
<f:link.email email="foo@bar.tld">some custom content</f:link.email>
Copied!
Output:
Email link with custom subject and prefilled cc
<f:link.email email="foo@bar.tld" subject="Check out this website" cc="foo@example.com"">some custom content</f:link.email>
Copied!
Output:
<a href="mailto:foo@bar.tld?subject=Check%20out%20this%20website&cc=foo%40example.com">some custom content</a>
Copied!
Depending on spamProtectEmailAddresses setting.
Source code
Go to the source code of this ViewHelper: Link\EmailViewHelper.php (GitHub).
Arguments
Allows arbitrary arguments
This ViewHelper allows you to pass arbitrary arguments not defined below directly
to the HTML tag created. This includes custom
data-
arguments.
The following arguments are available for the link.email ViewHelper:
additionalAttributes
-
- Type
- array
Additional tag attributes. They will be added directly to the resulting HTML tag.
aria
-
- Type
- array
Additional aria-* attributes. They will each be added with a "aria-" prefix.
bcc
-
- Type
- string
The email address(es) for BCC of the email link
body
-
- Type
- string
A prefilled body for the email link
cc
-
- Type
- string
The email address(es) for CC of the email link
data
-
- Type
- array
Additional data-* attributes. They will each be added with a "data-" prefix.
-
- Type
- string
- Required
- 1
The email address to be turned into a link
subject
-
- Type
- string
A prefilled subject for the email link