1

This is my first post but I thought I would ask the community for feedback.

Some background: I am creating an email for a client that would then take over uploading data extensions and sending the email.

In this email we are linking to a URL that will fill out a cart for the subscriber with some information we have in the data extension. The way I have the URL built is the following:

https://url.com/cart.html?name=%%owner_name%%&email=%%email%%&account=%%account_id%%&field_1=%%field_1%%&field_2=%%field_2%%&field_3=%%field_3%%

Then the data extension would fill in the required fields. My question is would it be better to create this URL using AMPScript? I am trying to make this easy for the client to manage and it seems like AMPScript might cause more issues then it fixes. The only issue without using AMPScript is that some of these fields might have a value of 0, and I could potentially eliminate them from the URL.

Any suggestions?

1 Answer 1

0

I'd recommend utilizing the concat and redirectto functions for your URL. Since you have so many parameters to set, I'd build the URL in an AMPscript block:

%%[

var @CTAURL
set @CTAURL = "https://url.com/cart.html"
set @CTAURL = concat(@CTAURL, "?name=", AttributeValue("owner_name"))
set @CTAURL = concat(@CTAURL, "&email=", AttributeValue("email"))
set @CTAURL = concat(@CTAURL, "&account=", AttributeValue("account_id"))
set @CTAURL = concat(@CTAURL, "&field_1=", AttributeValue("field_1"))
set @CTAURL = concat(@CTAURL, "&field_2=", AttributeValue("field_2"))
set @CTAURL = concat(@CTAURL, "&field_3=", AttributeValue("field_3"))

]%%
<a href="%%=redirectto(@CTAURL)=%%" alias="link1">link1</a>

The attributeValue function ensures that a value is returned for the substitution string -- whether it exists in the send context or not -- or if it's empty.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .