%%[
VAR @portal, @auctionreference, @auctionobj, @auctioneerobj, @auctiontitle, @auctioneer, @auctiontext, @auctioneerlogo, @auctiondate, @auctionlocation, @auctioneerurl, @auctionurl, @auctioncurrency, @i, @titlelengthdiff
VAR @lot1obj, @lot1id, @lot1img, @lot1url, @lot1low, @lot1high, @lot1num, @lot1title, @lot1est
VAR @lot2obj, @lot2id, @lot2img, @lot2url, @lot2low, @lot2high, @lot2num, @lot2title, @lot2est
VAR @lot3obj, @lot3id, @lot3img, @lot3url, @lot3low, @lot3high, @lot3num, @lot3title, @lot3est
VAR @lot4obj, @lot4id, @lot4img, @lot4url, @lot4low, @lot4high, @lot4num, @lot4title, @lot4est
VAR @lot5obj, @lot5id, @lot5img, @lot5url, @lot5low, @lot5high, @lot5num, @lot5title, @lot5est
VAR @lot6obj, @lot6id, @lot6img, @lot6url, @lot6low, @lot6high, @lot6num, @lot6title, @lot6est
VAR @lot7obj, @lot7id, @lot7img, @lot7url, @lot7low, @lot7high, @lot7num, @lot7title, @lot7est
VAR @lot8obj, @lot8id, @lot8img, @lot8url, @lot8low, @lot8high, @lot8num, @lot8title, @lot8est
VAR @lot9obj, @lot9id, @lot9img, @lot9url, @lot9low, @lot9high, @lot9num, @lot9title, @lot9est
VAR @lot10obj, @lot10id, @lot10img, @lot10url, @lot10low, @lot10high, @lot10num, @lot10title, @lot10est
/* ENTER EMAIL DATA HERE */
SET @auctionreference = ''
SET @townCity = LOOKUP('ent.AuctionDE', 'townCity', 'auctionreference', @auctionreference)
SET @countyState = LOOKUP('ent.AuctionDE', 'countyState', 'auctionreference', @auctionreference)
/* if less than 10 lots leave as (eg) SET @lot3id = '' */
SET @lot1id = ''
SET @lot2id = ''
SET @lot3id = ''
SET @lot4id = ''
SET @lot5id = ''
SET @lot6id = ''
SET @lot7id = ''
SET @lot8id = ''
SET @lot9id = ''
SET @lot10id = ''
/*Content for the grey box*/
SET @greytitle = ''
SET @greycontenttop = ''
SET @greycontentbottom = ''
/*Set Maximum number of lots you want to check for here - always put at least the number of lots you have added above, unless you only want a smaller number to show*/
SET @maxLots = 10
/* END OF DATA ENTRY */
/*Check how many lots there are in total - returns value of @lotNum as the number of lots*/
Set @lotNum = 0
For @num = 1 To @maxLots Do
SET @item = CONCAT("%%=v(@lot",@num,'id',')=%%')
IF LENGTH(TreatAsContent(@item)) > 0 THEN
SET @lotNum = @num
ENDIF
NEXT @num
SET @portal = "https://www.bidspotter.com/" /*Include forward slash at the end of the portal URL*/
SET @auctionobj = ROW(LookupRows("ent.AuctionDE", "auctionReference", @auctionreference), 1)
SET @auctioneerobj = ROW(LookupRows("ent.client", "clientId", FIELD(@auctionobj , "clientId")), 1)
SET @auctiontitle = FIELD(@auctionobj, "Title")
SET @auctioneer = FIELD(@auctioneerobj, "clientName")
SET @auctioneerlogo = FIELD(@auctioneerobj, "logoUrl")
SET @auctiondate = CONCAT(FORMATDATE(FIELD(@auctionobj, "AuctionDateTimeLocal"),'dd MMM yyyy', 'hh:mm'),' ',FIELD(@auctionobj, "timezone"))
SET @auctioneerurl = FIELD(@auctioneerobj, "UrlName")
SET @auctionurl = CONCAT(@portal, 'en-us/auction-catalogues/', @auctioneerurl, '/catalogue-id-',@auctionreference,'?utm_source=bs-bespoke-auc&utm_medium=email&utm_campaign=',@auctioneerurl,'&utm_content=',@auctionreference,'&utm_term=',FORMATDATE(NOW(),'yyyy/mm/dd')))
SET @featuredURL = "https://www.bidspotter.com/en-us/featured-lots"
SET @auctioncurrency = FIELD(@auctionobj, "Currency")
/*Populate content loop - dynamic variables*/
For @num = 1 To @lotNum Do
IF LENGTH(TreatAsContent(CONCAT("%%=v(@lot",@num,'id',')=%%'))) > 0 THEN
/*Set Temporary Variables*/
SET @TempID = TreatAsContent(CONCAT("%%=v(@lot",@num,'id',')=%%'))
SET @TempRow = ROW(LookupRows("ent.LotDE", "lotId", @TempID), 1)
SET @TempObj = @TempRow
SET @TempImg = CONCAT(TRIM(FIELD(@TempObj, "firstLotImage")),'540x360.jpg')
SET @TempImgMob = CONCAT(TRIM(FIELD(@TempObj, "firstLotImage")),'540x360.jpg')
SET @TempURL = CONCAT(@portal, "en-us/auction-catalogues/", @auctioneerurl, "/catalogue-id-", @auctionReference, "/lot-", @TempID, "?utm_source=tsr-lap-",FORMATDATE(NOW(),'dd/mm/yyyy'),"&utm_medium=email&utm_campaign=",@auctioneer)
SET @TempLow = FIELD(@TempObj, "lowEstimate")
SET @TempHigh = FIELD(@TempObj, "highEstimate")
/*SET @TempEST1 = Concat(FormatNumber(@TempLow , "#,###"),' - ',FormatNumber(@TempHigh , "#,###"),' ',@auctioncurrency)
SET @TempEST2 = Concat(FormatNumber(@TempLow , "#,###"),' ',@auctioncurrency)
SET @TempEST3 = Concat(FormatNumber(@TempHigh , "#,###"),' ',@auctioncurrency)*/
SET @TempNum = FIELD(@TempObj, "lotNumber")
SET @TempTitle = TRIM(FIELD(@TempObj, "title"))
/*Assign Variables Proper*/
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "title = @TempTitle ]%", "%") )
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "img = @TempImg ]%", "%") )
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "imgmob = @TempImgMob ]%", "%") )
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "url = @TempURL ]%", "%") )
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "num = @TempNum ]%", "%") )
/*IF LENGTH(@TempLow) > 0 THEN
IF LENGTH(@TempHigh) > 0 THEN
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "est = @TempEST1 ]%", "%") )
ELSE
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "est = @TempEST2 ]%", "%") )
ENDIF
ELSE
IF LENGTH(@TempHigh) > 0 THEN
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "est = @TempEST3 ]%", "%") )
ELSE
TreatAsContent( Concat( "%", "%[ SET @lot", @num, "est = '' ]%", "%") )
ENDIF
ENDIF*/
ENDIF
NEXT @num
/*
Example of old variable assignment code which was duplicated (@lot1obj, @lot2obj, etc) - only for reference
IF LENGTH(@lot1id) > 0 THEN
SET @lot1obj = ROW(LookupRows("ent.LotDE", "lotId", @lot1id), 1)
SET @lot1img = CONCAT(TRIM(FIELD(@lot1obj, "firstLotImage")),'540x360.jpg')
SET @lot1url = CONCAT(@portal, "en-gb/auction-catalogues/", @auctioneerurl, "/catalogue-id-", @auctionReference, "/lot-", @lot1id, "?utm_source=tsr-lap-",FORMATDATE(NOW(),'dd/mm/yyyy'),"&utm_medium=email&utm_campaign=",@auctioneer)
SET @lot1low = FIELD(@lot1obj, "lowEstimate")
SET @lot1high = FIELD(@lot1obj, "highEstimate")
SET @lot1num = FIELD(@lot1obj, "lotNumber")
SET @lot1title = TRIM(FIELD(@lot1obj, "title"))
IF LENGTH(@lot1low) > 0 THEN
IF LENGTH(@lot1high) > 0 THEN
SET @lot1est = Concat(FormatNumber(@lot1low , "#,###"),' - ',FormatNumber(@lot1high , "#,###"),' ',@auctioncurrency)
ELSE
SET @lot1est = Concat(FormatNumber(@lot1low , "#,###"),' ',@auctioncurrency)
ENDIF
ELSE
IF LENGTH(@lot1high) > 0 THEN
SET @lot1est = Concat(FormatNumber(@lot1high , "#,###"),' ',@auctioncurrency)
ELSE
SET @lot1est = ''
ENDIF
ENDIF
ENDIF
*/
]%%
SET @title = CONCAT("%%=v(@lot",@y,'title',')=%%')
SET @image = CONCAT("%%=v(@lot",@y,'img',')=%%')
SET @imageMob = CONCAT("%%=v(@lot",@y,'imgmob',')=%%')
SET @url = CONCAT("%%=v(@lot",@y,'url',')=%%')
SET @num = CONCAT("%%=v(@lot",@y,'num',')=%%')
SET @est = CONCAT("%%=v(@lot",@y,'est',')=%%')
]%%
Lot %%=TreatAsContent(@num)=%% %%=TreatAsContent(@title)=%%...
You are receiving this email because you subscribed to receive emails at our website www.bidspotter.com
To ensure that your emails get through to your inbox, please add bidspotter@mail.bidspotter.com to your email Address Book.
SUBSCRIPTION PREFERENCES
If you would like to change your subscription preferences please click here. View your profile by clicking here. If you no longer want to receive these emails from us, please click here to unsubscribe from our mailing list.