Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naveenvm93/6ccfee6dcca8a80e26f7b2cd26ece9ac to your computer and use it in GitHub Desktop.
Save naveenvm93/6ccfee6dcca8a80e26f7b2cd26ece9ac to your computer and use it in GitHub Desktop.
Integrate-Wix-With-Salesforce-Marketing-Cloud
%%[ var @contactform,@Email, @formEmpty
set @contactform = "false"
set @formEmpty = "false"
if RequestParameter("submitted") == "submitted"
then
set @contactform = "True"
Set @Email = RequestParameter("emailaddress")
IF NOT EMPTY(RequestParameter("emailaddress"))
THEN Set @UpsertData = UpsertDE('Contact_form','1','emailaddress',@Email,'submitteddate',NOW()) Else Set @formEmpty = "True" ENDIF
ENDIF]%%
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 5px;
background-color: #ffffff;
padding: 20px;
height: auto !important;
}
</style>
<div class="container">
<form action="%%=RequestParameter('PAGEURL')=%%" method="POST">
<label for="fname">Email Address</label> <input id="fname" name="emailaddress" placeholder="Your email address.." type="text"> <input type="submit" value="Submit">&nbsp; <input id="submitted" name="submitted" type="hidden" value="submitted">%%[ IF @contactform == "true" and @formEmpty == "false" then ]%%<br>
<br>
Thanks for Subscribing %%[ ENDIF ]%% %%[ IF @contactform == "true" and @formEmpty == "true" then ]%%<br>
<br>
Your Email Address is Empty %%[ ENDIF ]%%
</form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment