vitamin2/v2-spam-free-mail

V2 Spam Free Mails

0.2.3 2023-01-11 12:29 UTC

This package is auto-updated.

Last update: 2024-04-11 15:40:27 UTC


README

Just a plugin which decrypts the email addresses on the fly.

Installation

Download

Download and copy this repository to /site/plugins/vitamin2/v2-spam-free-mail.

Composer

composer require vitamin2/v2-spam-free-mail

Usage

  1. Install plugin

  2. Add Spam Free JS to your template (getSpamFreeJs returns a versionised JS file)

  <?= js([
    getSpamFreeJs(),
  ]) ?>
  1. Preload it (optional)
  <link rel="preload" href="<?= getSpamFreeJs() ?>" as="script" />
  1. Use It. For text fields it will be used automatically. For other fields you can use the snippet.
    <?= snippet("global/protected-mail", [
        "emailAddress" => $site->emailAddress()->value(),
        "emailText" => $site->emailAddress()->value(),
        "customAttributes" => [
            "class" => "link-footer",
            "rel" => "noopener noreferrer",
            "target" => "_blank",
            "title" => "link-footer",
        ],
    ]) ?>

License

MIT