====== <#share_url_by_email> ====== Use this function to send an url link 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 | | Url | No | The url to share. If empty the current url will be taken | | From | Yes | the sender email | | To | Yes | the recipient email | ==== Error Codes ==== ^ Code ^ Description ^ | 122 | Wrong Captcha| ==== Example ==== Exemple of the template : <#if condition="<#AMRequest.values['Url'] checksum=1>"> <#AMRequest.values['Url']>
<#else> <#Url>
<#endif> <#if condition="<#AMRequest.values['message'] checksum=1>">
<#AMRequest.values['message']>
<#endif>

Message sent via <#url id=/>
Exemple of [[en:public:developer:template_system:cfgpages]] configuration node maintemplates\maintemplate_empty.html <#content_type> Exemple of API call ak_call_api("/api/share_url_by_email/", /* the api url */ { From: "me@exemple.com", To: "you@exemple.com", Message: "my message", Recaptcha_challenge: Recaptcha.get_challenge(), Recaptcha_response: Recaptcha.get_response() }, /* the post params */ ... );