Trustpilot AMPscript

                  <!--======== Trustpilot links ========-->

%%[
Var @splitname,@studyloc,@classID,@email,@fullname,@secretkey,@hash,@hashSHA1,@email64,@fullnameURLencode,@prefix_lang,@BaseURL,@KaplanURL,@FullURL
SET @studyloc = [Study Where]
SET @classID = [CLASS Student ID]
SET @email = [Email Address]
SET @fullname = [Full Name1]

SET @splitname = BUILDROWSETFROMSTRING([emailname_],"-")
/* BUILDROWSETFROMSTRING will create a row set for every string seperated by a "-" */
IF ROWCOUNT(@splitname) > 1 THEN
/* This ROWCOUNT is a 'check' to make sure that the more than one "-" is in the string, that is, that the row set value is greater than one */
SET @prefix_lang = FIELD(ROW(@splitname,1),"VALUE")
/* This will look into the built row set, and grab the first (1) value. So in the case of EN-EN-team-PROMO-summersale, it will pull "EN" */
ENDIF

SET @secretkey = Lookup("Publicaton_TrustpilotURL_KaplanURL", "secretkey", "Publication", @prefix_lang)
SET @hash = CONCAT(@secretkey, @email, @classID)
SET @hashSHA1 = SHA1(@hash)
SET @email64 = Base64Encode(@email)
SET @fullnameURLencode = URLEncode(@fullname,1,1)

SET @BaseURL = Lookup("Publicaton_TrustpilotURL_KaplanURL", "TrustpilotURL", "Publication", @prefix_lang)
SET @KaplanURL = Lookup("Publicaton_TrustpilotURL_KaplanURL", "KaplanURL", "Publication", @prefix_lang)
SET @FullURL = CONCAT(@BaseURL, @KaplanURL)
SET @FullURL = CONCAT(@FullURL, '?a=', @classID)
SET @FullURL = CONCAT(@FullURL, '&b=', @email64)
SET @FullURL = CONCAT(@FullURL, '&c=', @fullnameURLencode)
SET @FullURL = CONCAT(@FullURL, '&e=', @hashSHA1)

SET @BaseURLreview = Lookup("Publicaton_TrustpilotURL_KaplanURL", "review", "Publication", @prefix_lang)
SET @FullURLreview = CONCAT(@BaseURLreview, @KaplanURL)
SET @FullURLreview = CONCAT(@FullURLreview, '?a=', @classID)
SET @FullURLreview = CONCAT(@FullURLreview, '&b=', @email64)
SET @FullURLreview = CONCAT(@FullURLreview, '&c=', @fullnameURLencode)
SET @FullURLreview = CONCAT(@FullURLreview, '&e=', @hashSHA1)

]%%