Form subscribe checkbox
This commit is contained in:
parent
0b9784dbe7
commit
452b9bee54
@ -142,7 +142,7 @@
|
||||
{% if option.value %}
|
||||
<label for="field-{{ name }}-{{ option.value }}">
|
||||
<input type="checkbox"
|
||||
name="{{ name }}[]"
|
||||
name="{{ name }}"
|
||||
id="field-{{ name }}-{{ option.value }}"
|
||||
value="{{ option.value }}"
|
||||
{% if option.note %}aria-describedby="description-{{ name }}-{{ option.value }}"{% endif %}
|
||||
@ -150,7 +150,7 @@
|
||||
{% else %}
|
||||
<label for="field-{{ name }}-{{ option }}">
|
||||
<input type="checkbox"
|
||||
name="{{ name }}[]"
|
||||
name="{{ name }}"
|
||||
id="field-{{ name }}-{{ option }}"
|
||||
value="{{ option }}"
|
||||
>{{ option }}</label>
|
||||
|
@ -31,9 +31,9 @@
|
||||
{{ label("Votre message", "message") }}
|
||||
{{ textarea( "message", { required: true, autocapitalize: "sentences", spellcheck: "true" } ) }}
|
||||
</li>
|
||||
{# <li class="[ field-list__field-group ] [ full-width ]">
|
||||
{{ checkboxes("", "field-checkbox-name", [ "Je souhaite être tenu au courant de l’actualité Astrolabe"], { description: "" } ) }}
|
||||
</li> #}
|
||||
<li class="[ field-list__field-group ] [ full-width ]">
|
||||
{{ checkboxes("", "subscribe", [ "Je souhaite être tenu au courant de l’actualité Astrolabe"], { description: "" } ) }}
|
||||
</li>
|
||||
{# <li hidden>
|
||||
<label>Don’t fill this out if you're human: <input name="bot-field" /></label>
|
||||
</li> #}
|
||||
|
@ -10,6 +10,7 @@
|
||||
$emailAddress = $_POST['email'];
|
||||
$select = $_POST['select'];
|
||||
$message = $_POST['message'];
|
||||
$subscribe = $_POST['subscribe'];
|
||||
|
||||
if (!filter_var($emailAddress, FILTER_VALIDATE_EMAIL)) {
|
||||
$errors .= "\n Error: Invalid email address $emailAddress";
|
||||
@ -53,6 +54,11 @@
|
||||
|
||||
// send the email
|
||||
mail($to, $emailSubject, $emailBodyHTML, implode("\r\n", $headers));
|
||||
|
||||
// if subscribe add to mailing list
|
||||
if(!empty($subscribe)) {
|
||||
// process
|
||||
}
|
||||
|
||||
// redirect to the 'thank you' page
|
||||
header("Location: /thank-you/index.html");
|
||||
|
Loading…
Reference in New Issue
Block a user