Getting the encoded mail address from (email:...) without the anchor – possible?

Hey there.
First, here is an overview of my structure:

<a class="button someClass" href="mailto:hello@mail.com">
  <div class="someClass">
    <p class="button_text someClass"> <?= $support->support_button()->ktr() ?></p>
  </div>
  <div class="someClass button-shadow">
  </div>
</a>

It is supposed to be a button, that is basically a mailto: link.
I love the (email:…) function automatically encoding the mail address, and would like to embed it into my structure. Is that possible?
Right now it doesn’t work, because it builds a new anchor with the (email:…) function.:

<a class="button someClass" href="<?= $support->email_from_the_function()->ktr() ?>">
  <div class="someClass">
    <p class="button_text someClass"> <?= $support->support_button()->ktr() ?></p>
  </div>
  <div class="someClass button-shadow">
  </div>
</a>

I guess the real question is, is there a way to get the email encoded in Kirby without getting the anchor as well?

What is in the support_button field? and what is ktr()

Why don’t you just store the email address instead of an email kirbytag in the field?

And use Str::encode() to encode the email address.

I use like that: <?= $page->emailField()->encode() ?>

Kirby::plugin('my/plugin', [
    'fieldMethods' => [
        'encode' => function ($field) {
            return \Kirby\Toolkit\Str::encode($field->value);
        }
    ]
]);

support_button is in the .txt the (email:…) kirbytag.
ktr() is kirbytext raw… guess not needed here at all.

Ah nice. Didn’t know the encode() option. This is what I needed
thanks.