0

We have a monthly newsletter for a product interest group. We would like to use a data extension to store email content (subject line, preheader, etc.) that can be used. Within the data extension there is a date field to mark when the email content was used, before the email is sent this field is left blank.

The email content DE has been set up as not sendable or testable. Can someone advise on how to use ampscript to ensure each row in the data extension is only used 1x. Each row contains email copy for 1 send.

To retrieve email content: This is what I was thinking...

%%[ var @subjectline, @preheader,

set @subjectline = Lookup("ContentDEName", "subjectline", "Date") set @preheader = Lookup("ContentDEName", "preheader", "Date",) ]%%

%%=v(@subjectline)=%%

%%=v(@preheader)=%%

To mark date used:

  • you need to retrieve the subjectline and preheader column values based on date field ? – pkharries Jul 4 '18 at 5:57
0

@Amanda Record try like this

 %%[ 
 VAR @lookUp,@subjectline, @preheader, @email, @from_row


 set @date= "baesed on  date value it will retrieve"

 Set @lookUp = LookupRows("ContentDEName","Date",@date)

 IF RowCount(@lookUp) > 0 THEN 

 SET @Count = RowCount(@lookUp)

 FOR @i = 1 to @Count DO

  SET @from_row = Row(@lookUp,@i)
  SET @subjectline = Field(@from_row,"subjectline")
  SET @preheader = Field(@from_row,"preheader")
   NEXT @i
    ENDIF
  ]%%
   subject:%%=v(@subjectline)=%%

   preheader:%%=v(@preheader)=%%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.