Is there a way to send out an automated email notification (to a pre-defined email address) every time a new subscriber enters a Data Extension in SFMC?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Approach 1: Use AMPscripting to calculate new records
Step 1: Create a simple email that will have following ampscripting (my example uses new records today but you can tweak this to new records in the past hour).
%%[ VAR @currentSystemTime, @Today SET @currentSystemTime = NOW() SET @Today= FormatDate(SystemDateToLocalDate(@currentSystemTime), "YYYY-MM-DD") ]%% %%[ var @rows, @row, @rowCount, @numRowsToReturn, @i set @rows = LookupRows("TestDE","SubmissionDate",@Today) set @rowCount = rowcount(@rows) if @rowCount > 0 then for @i = 1 to @rowCount do var @EmailAddress set @row = row(@rows,@i) /*get row based on loop counter */ set @EmailAddress = field(@row,"EmailAddress") ]%%
Step 2: Set up an automation that runs on your cadence, with the email in Step 1.
Pros: Not too many steps Cons: An email will be send based on the cadence you chose, even if 0 records were added.
Approach 2: Use SQL to calculate new records
Step 1: Create a field named Entry_Dt (data type: date; nullable field; set default value to current date). Whenever a record is inserted into the DE, the current date will be added to the record.
Step 2: Build a new DE that will capture results of SQL that will run in Step 3.
Step 3: Build a SQL query that returns all records that were inserted into the DE in the past hour (or your preferred cadence), based on the Entry_Dt field in Step 1.
Step 4: Create a list of email addresses who should receive this new records emails by building a list under Subscribers > My Subscribers > My Lists.
Step 5: Build a simple email that captures the results from the DE that you created in Step 2.
Step 6: Build an automation that runs the SQL, add a validation rule that check how many new records exist. If > 0, then Send email, else end automation.
Pros: Only sends an email when new records are added. Cons: More steps involved
Hope this helps!