Mailto: from query/repeater

Hi, I would like to create an employee list with corresponding data and emails as ACF.

I used a email field in ACF and a cwicly repeater to let it pop up un my site. That works fine but I would like the email clickable (mailto:)

I tried different methods but I couldn’t achieve it.

Does somebody have any Ideas how to achieve this?

Edit:
I have an ACF field (containing e-mail in some form).
I would like this field to appear as a clickable link
<a href="mailto:my@field.com">my@field.com or something else</a>

Do you have a live site?
What’s your exact approach?
Do you use dynamic attributes?

Not aware of a current solution which can give you mailto:my@field.com, by only inserting my@field.com.
You would need to prepend mailto: inside your email field every time but can’t say for sure.
There might be some code snippet which can inject that for you on page load.

1 Like

Hey @T-low,

Must have missed this.

While we don’t currently offer a ready solution for this, you can use the following as a static url:
mailto:{acffield=yourfieldnamehere}

2 Likes

Hi @Marius and @Louis, thanks for the replies.

Works :+1:

I have a custom post type (CPT UI) that contains my staff members.
Each staff member has several fields ACF and also a field for email.
This email field should only contain an e-mal with no code, hence the question.

So I am currently trying to display a dynamic email as a clickable link.

For the solution, I am using a query to filter by the staff I want.
If I want the content to display only the clickable email, I use a header and use the dynamic content to display it. Then I use the code from @Louis to add the clickability (href).
If I want to add something other than just the email, I would wrap that with the header in a div and link that as href.

1 Like

Thanks for elaborating @T-low.
Seems like a common use case.
Will bookmark :sunglasses:

Totally forgot about this approach, thanks for the reminder @Louis, bookmarked as well.

1 Like