Contact Us

FormObject

In[]:=
fo=FormObject[<|​​"name"<|​​"Label""Name",​​"Interpreter""String",​​"Required"True​​|>,​​"email"<|​​"Label""Email",​​"Interpreter""EmailAddress",​​"Required"True​​|>,​​"message"<|​​"Label""How can we help you?",​​"Interpreter""TextArea",​​"Required"True​​|>​​|>,​​AppearanceRules<|​​"Title""Contact Us",​​"Description""Do you have a question? Fill out the form below, and someone will answer shortly.",​​"IncludedCSS"ContactCSS,​​"ItemLayout""Vertical"​​|>​​]

CSS

ContactCSS=" body { background: #fff; }    .panel, .panel-default, .panel-footer {    background: #fff;    border: 0;    box-shadow: none;    }    .form-object > .form-title {    color: #dd1100;    font-size: 4rem;    font-weight: 400;    }    ";

Email

form:=FormFunction[fo,​​(​​SendMail[<|​​"To"{"nobody@gmail.com"},​​"Subject""SUBJECT",​​"Body"StringJoin[​​"Name: ",#name,"\n",​​"Email: ",#email,"\n",​​"Message: ",#message,"\n"​​]​​|>];​​HTTPResponse[acknowledgement]​​)&​​];

Thank You Message

In[]:=
acknowledgement="<h2>Thank you for submitting your request. You will be contacted soon regarding its status.</h2>"

Deploy Form

In[]:=
form1=CloudObject["contact-us"]​​enco=CloudDeploy[form,form1,Permissions"Public"]