← API Index · How to use components

mail component .oo-mail

Allows visitors to send an e-mail to the shop operator. All form elements with a name attribute inside the component are mailed; a field email (the sender) and a field info (the message) are required in the template. If an authenticated customer uses the form, their customer number is added automatically.

How components are mounted, how switch values are resolved and how debug output is enabled is described in the use-js-components skill.

<div class="oo-mail"></div>

You may use your own template — wrap similar HTML with <div class="oo-mail">…</div> and use the classes oo-mail-email, oo-mail-field, oo-mail-sendbtn, oo-mail-unsent and oo-mail-sent appropriately.

Spam protection (captcha)

For visitors who are not logged in (or guests) the form is protected by the shop's ALTCHA captcha (shop setting "Spam-Schutz (ALTCHA)", group Mail, on by default); a logged-in customer sees no captcha. The component handles it like the subscribe component does: it asks the shop, places the widget in a <div class="oo-altcha"> in front of .oo-mail-sendbtn, solves while the visitor fills in the form and sends the solution with it. Rejections show the shop's text boss.mail.captcha in the flash.

With the captcha switched off, messages from visitors who are not logged in are rejected — the captcha is what makes the form usable for them. The page requirements (HTTPS, CSP worker-src data:, keeping the send button in an own template, styling via --altcha-* variables) are the same as for subscribe.

component switches

Switch Default Description
oo-mail-istest false true sends the mail to the tester's e-mail address configured in the backend instead of the shop's order address. Good for testing a new form.

debug options

Debug scope mail (enable with data-oo-debug="true" on the element or debug:mail:all+, see the skill):

Term Description
mail:all Field collection, URL parameter mapping, readiness checks, send result.