Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

Name personalisation AMPScript

$
0
0

We are building an email that has a concert ticket with a name box that pulls in firstname and surname.

My issue is:

I need to have it read "VIP MEMBER" for any firstname and surname that are less than 2 characters or more than 13.

However I cant seem to find a way that if the customer was firstname=G and lastname=Minshall it will display "VIP MINSHALL" or firstname=Graeme and lastname=M it will display "GRAEME MEMBER".

I wanted to try and concatenate the two fields and count the amount of charachter's then default to "VIP MEMBER" for any user that fall outs of the criteria.

My current code is below:

%%[var @lnamevar @fnameset @lname=Surnameset @fname=Firstnameset @lname=UPPERCASE(@lname)set @fname=UPPERCASE(@fname)IF (Length(@lname)>13)then    set @lname="MEMBER"ELSEIF (Length(@lname)<2)then    set @lname="MEMBER"ENDIFIF (Length(@fname)>13)then    set @fname="VIP"ELSEIF (Length(@fname)<2)then    set @fname="VIP"ENDIF]%%

In the email content ticket area I'm putting %%= v(@fname) =%% %%= v(@lname) =%% in the ticket name box.

Any help on how to achieve the above is appreciated.


Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>