I have two data extensions:
- Data extension 1:
API_Onboarding_OnlineMemberships
has the following column:SUBS_START_DATE
(this DE gets the emails) - Data extension 2:
Customers
has the following column:DATE_OF_FIRST_SUB_AEST
Here's the amp script I've updated in the email:
%%[
SET @SUBS_START_DATE = Lookup("API_Onboarding_OnlineMemberships","SUBS_START_DATE","CUSTOMER_INTERNAL_NS_ID", @CUSTOMER_INTERNAL_NS_ID)
SET @DATE_OF_FIRST_SUB_AEST = Lookup("Customers","DATE_OF_FIRST_SUB_AEST","CUSTOMER_INTERNAL_NS_ID", @CUSTOMER_INTERNAL_NS_ID)
IF @SUBS_START_DATE > @DATE_OF_FIRST_SUB_AEST THEN
SET @output = "Welcome Back"
ELSE
SET @output = "Welcome"
ENDIF
]%%
%%=v(@output)=%%
It should show 'Welcome Back' if @Subs_Start_Date is today and the @Date_of_first_sub_aest is yesterday...
@CUSTOMER_INTERNAL_NS_ID is the Subscriber key for both data extensions, but not necessarily the primary key for both.
This ampscript doesn't render the right data i.e., Welcome or Welcome back email. Am I missing something?