How to use Custom Field (data type URL) as Button Link in an email?

Hi all,

Hope you can help me. I’ve added the following custom field into our Mautic installation:

  • Label: Campaign URL
  • Alias: campaign_url
  • Object: Contact
  • Group: Core
  • Data Type: URL

How can I get that campaign_url value as the A HREF value of a Button Link in an email?

I’ve already tried {contactfield=campaign_url} in the Button Link property of my button but when I sent a test mail the link is not there.

When I use the {contactfield=campaign_url} in a text block it just shows the Custom Field label and not the value.

Am I missing something obviously?
Or am I doing something wrong at all?


We simply used a text field to hold the URL and then user href=“{contactfield=texturl}”

So you’re saying that the data type is wrong… hmm… that would be weird but I’ll give it a try.

If needed I’ll just recreate the custom field and push all the custom URLs to the new setup (as text field) then.

Not at all. I personally have not used the datatype URL. I was just showing you how we did it

I know - thanks for your replies anyway, much appreciated!!

I’m getting more lost by the minute at the moment. Regardless what I try, I don’t see the href tag in the button code when the test message is sent and when I just add the { } tag to a text block then I only get [labelname] instead of the actual value in the test mail.

Is it perhaps that you only get those values when you actually send out a mailing to a segment?

I have not tried the url but yes that the block variable string is only shown in all test email on other data fields for me. It’ll have to be sent as an actual email to see the result.

We have a segment created for this purpose and only few of our staff are in that segment so they can confirm that the block variable is working as intended before sending out to our segment groups or subscribers.

1 Like

Yse correct, the values for test email will not be shown, you need to do a proper send. Maybe I should have mentioned this earlier :slight_smile:

1 Like

@mikew @techbill thanks!!!

I got it working now. I ended up creating a new segment (Internal TEST) and a new email message (Email TEST) so I can test things and demonstrate it to those who actually work with Mautic for their communications. Much better than getting on a wild goose chase because something doesn’t seem to be doing what you expect when using the send test message function :wink:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.