AMPSCRIPT BLOCK : LOOKUP PRODUCT WHERE ORDER ID =1
%%[
SET @subscriberkey=_subscriberkey
SET @email=emailaddr
SET @Orderid=1
SET @customerId=LookUp('ORDERS','CUSTOMERID','ORDERID',@Orderid)
SET @productId=LookUp('ORDER_DETAILS','PRODUCTID','ORDERID',@Orderid)
SET @ContactName=LookUp('CUSTOMERS','CONATACTNAME','CUSTOMERID',@customerId)
SET @productName=LookUp('PRODUCTS','PRODUCTNAME','PRODUCTID',@productId)
SET @productPrice=LookUp('ORDERS','UNITPRICE','ORDERID',@Orderid)
SET @productPackagingDate=LookUp('ORDERS','SHIPDATE','ORDERID',@Orderid)
]%%
%%=v(Concat('Hello ',@ContactName,','))=%%
<p>Please find your invoice details</p>
<div><b>Product Details</b></div>
<div></div>
<div><b>Name </b>: %%=v(UPPERCASE(@productName))=%%</div>
<div><b>Price</b> :%%=v(FORMATCURRENCY(@productPrice,'en-US',3))=%%</div>
<div><b>Packaging Date </b>:
%%=v(FORMATDATE(@productPackagingDate,'MMM DD, YYYY'))=%%</div>
AMPSCRIPT BLOCK : LOOKUP PRODUCT WHERE ORDER ID =1 AND EMPLOYEE ID=12345
%%[
SET @subscriberkey=_subscriberkey
SET @email=emailaddr
SET @Orderid=1
SET @customerId=LookUp('ORDERS','CUSTOMERID',
'ORDERID',@Orderid,
'EMPLOYEEID',12345)
SET @productId=LookUp('ORDER_DETAILS','PRODUCTID','ORDERID',@Orderid,'DISCOUNT',20)
SET @ContactName=LookUp('CUSTOMERS','CONATACTNAME','CUSTOMERID',@customerId)
SET @productName=LookUp('PRODUCTS','PRODUCTNAME','PRODUCTID',@productId)
SET @productPrice=LookUp('ORDERS','UNITPRICE','ORDERID',@Orderid)
SET @productPackagingDate=LookUp('ORDERS','SHIPDATE','ORDERID',@Orderid)
]%%
%%=v(Concat('Hello ',@ContactName,','))=%%
<p>Please find your invoice details</p>
<div><b>Product Details</b></div>
<div></div>
<div><b>Name </b>: %%=v(UPPERCASE(@productName))=%%</div>
<div><b>Price</b> :%%=v(FORMATCURRENCY(@productPrice,'en-US',3))=%%</div>
<div><b>Packaging Date </b>:
%%=v(FORMATDATE(@productPackagingDate,'MMM DD, YYYY'))=%%</div>
AMPSCRIPT BLOCK : LOOKUP PRODUCT WHERE ORDER ID =1 AND EMPLOYEE ID=12345 AND SHIPDATE IS TODAY
%%[
SET @subscriberkey=_subscriberkey
SET @email=emailaddr
SET @Orderid=1
SET @customerId=LookUp('ORDERS','CUSTOMERID',
'ORDERID',@Orderid,
'EMPLOYEEID',12345,
'ORDERDATE',NOW())
SET @productId=LookUp('ORDER_DETAILS','PRODUCTID','ORDERID',@Orderid,'DISCOUNT',20)
SET @ContactName=LookUp('CUSTOMERS','CONATACTNAME','CUSTOMERID',@customerId)
SET @productName=LookUp('PRODUCTS','PRODUCTNAME','PRODUCTID',@productId)
SET @productPrice=LookUp('ORDERS','UNITPRICE','ORDERID',@Orderid)
SET @productPackagingDate=LookUp('ORDERS','SHIPDATE','ORDERID',@Orderid)
]%%
%%=v(Concat('Hello ',@ContactName,','))=%%
<p>Please find your invoice details</p>
<div><b>Product Details</b></div>
<div></div>
<div><b>Name </b>: %%=v(UPPERCASE(@productName))=%%</div>
<div><b>Price</b> :%%=v(FORMATCURRENCY(@productPrice,'en-US',3))=%%</div>
<div><b>Packaging Date </b>:
%%=v(FORMATDATE(@productPackagingDate,'MMM DD, YYYY'))=%%</div>
%%=v(Concat('Hello ',@ContactName,','))=%%
<p>Please find your invoice details</p>
<div><b>Product Details</b></div>
<div></div>
<div><b>Name </b>: %%=v(UPPERCASE(@productName))=%%</div>
<div><b>Price</b> :%%=v(FORMATCURRENCY(@productPrice,'en-US',3))=%%</div>
<div><b>Packaging Date </b>:
%%=v(FORMATDATE(@productPackagingDate,'MMM DD, YYYY'))=%%</div>
AMPSCRIPT BLOCK :
LOOKUP PRODUCT WHERE PRODUCT ID =1 AND GENDER='WOMEN' AND SEASON='WINTER' , IF NO PRODCT IS FOUND RAISE ERROR
%%[
SET @subscriberkey=_subscriberkey
SET @email=emailaddr
SET @Orderid=1
SET @customerId=LookUp('ORDERS','CUSTOMERID',
'ORDERID',@Orderid,
'EMPLOYEEID',12345,
'ORDERDATE',NOW())
SET @productId=LookUp('ORDER_DETAILS','PRODUCTID','ORDERID',@Orderid,'DISCOUNT',20)
SET @ContactName=LookUp('CUSTOMERS','CONATACTNAME','CUSTOMERID',@customerId)
SET @productName=LookUp('PRODUCTS','PRODUCTNAME','PRODUCTID',@productId)
SET @productPrice=LookUp('ORDERS','UNITPRICE','ORDERID',@Orderid)
SET @productPackagingDate=LookUp('ORDERS','SHIPDATE','ORDERID',@Orderid)
]%%
%%[IF EMPTY(@productName) THEN
INSERTDE(
'PERSONALIZATIONLOG',
'ERRORMESSAGE','No Products found',
'ERRORCODE','E003',
'ERRORNUMBER','1234',
'SUBSCRIBERKEY',_SUBSCRIBERKEY,
'JOBID',JOBID
)
RAISEERROR('No Products found',1,'SHIPPING ERROR','1234',0) ]%%
%%[ ELSE ]%%
%%=v(Concat('Hello ',@ContactName,','))=%%
<p>Please find your invoice details</p>
<div><b>Product Details</b></div>
<div></div>
<div><b>Name </b>: %%=v(UPPERCASE(@productName))=%%</div>
<div><b>Price</b> :%%=v(FORMATCURRENCY(@productPrice,'en-US',3))=%%</div>
<div><b>Packaging Date </b>:
%%=v(FORMATDATE(@productPackagingDate,'MMM DD, YYYY'))=%%</div>
%%=v(Concat('Hello ',@ContactName,','))=%%
<p>Please find your invoice details</p>
<div><b>Product Details</b></div>
<div></div>
<div><b>Name </b>: %%=v(UPPERCASE(@productName))=%%</div>
<div><b>Price</b> :%%=v(FORMATCURRENCY(@productPrice,'en-US',3))=%%</div>
<div><b>Packaging Date </b>:
%%=v(FORMATDATE(@productPackagingDate,'MMM DD, YYYY'))=%%</div>
%%[ ENDIF ]%%
Comments
Post a Comment