You will need a custom form instead of Smart Capture, as you will need to build following logic:
- The CTA in the email should utilise CloudPagesUrl function, which will pass a.o. jobid to the landing page.
- A hidden input field, which holds the jobid passed from the email - this should be populated using
%%=AttributeValue(jobid)=%%
. Your destination Data Extension should also have this numerical field present.
- Once the form gets submitted, this hidden field will be passed to your data extension, along with the remaining form fields.
- To limit the number of your submissions, you will need to wrap the smartcapture block with two code snippets.
The top:
%%[
SET @job = AttributeValue(jobid)
SET @rows = RowCount(LookupRows("FormSubmissions","jobid", @job))
IF @rows < 51 THEN
]%%
The bottom:
%%[
ELSE
RedirectTo(CloudPagesURL(55555))
ENDIF
]%%
This will only display the form if less than 51 submissions happened from that particular sendjob, otherwise the visitor will be redirected to the cloud page ID 55555, which will display Contest closure page.