====== <#contact_us> ======
Use this function to send a contact request via email. This function will be typically called from
[[en:public:developer:template_system:cfgpages]].
==== Parameters ====
Parameters taken from the tag
^ Name ^ Mandatory ^ Description ^
| Privatekey | Yes | The [[http://www.google.com/recaptcha|ReCaptcha]] private key |
| Template | Yes | The mail template |
Parameters taken from HTTP GET/Post data
^ Name ^ Mandatory ^ Description ^
| Recaptcha_challenge | Yes | The value of "recaptcha_challenge_field" sent via the form |
| Recaptcha_response | Yes | The value of "recaptcha_response_field" sent via the form |
| email | Yes | the sender email |
| company | No | the sender company name |
| name | No | the sender name |
| first_name | No | the sender first name |
| product | No | the product |
| subject | No | the subject of the email |
==== Error Codes ====
^ Code ^ Description ^
| 122 | Wrong Captcha|
==== Example ====
Exemple of the template :
<#if condition="<#name checksum=1>">Name: <#name xmlencode=1>
<#endif>
<#if condition="<#first_name checksum=1>">First name: <#first_name xmlencode=1>
<#endif>
<#if condition="<#company checksum=1>">Company: <#company xmlencode=1>
<#endif>
<#if condition="<#email checksum=1>">Email: <#email xmlencode=1>
<#endif>
<#if condition="<#phone1 checksum=1>">Phone: <#phone1 xmlencode=1>
<#endif>
<#if condition="<#product checksum=1>">Product: <#product xmlencode=1>
<#endif>
<#if condition="<#message checksum=1>">
<#message xmlencode=1><#endif>
Exemple of [[en:public:developer:template_system:cfgpages]] configuration node
maintemplates\maintemplate_empty.html
<#content_type>
Exemple of API call
ak_call_api("/api/contact_us/", /* the api url */
{
Email: "me@exemple.com",
Name: "My Name",
Message: "my message",
Recaptcha_challenge: Recaptcha.get_challenge(),
Recaptcha_response: Recaptcha.get_response()
}, /* the post params */
...
);