<cob-contact-form id="contactForm" token="*****" default-subject="Patterns library feedback" to="digital+patterns@boston.gov" visible="visible"></cob-contact-form>
Web component for a Contact Form modal dialog. POSTs an email to our contact form service to be sent to an internal feedback address.
Include this component just before the </body>
closing tag on your page so
that it can cover the entire page when shown.
Will be hidden by default. Call the show()
method to show it or add a
visible
attribute.
<button onClick="document.getElementById('contactForm').show()">
Feedback
</button>
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
action |
action |
Defaults to https://contactform.boston.gov/emails but can be set for development testing. |
string |
'https://contactform.boston.gov/emails' |
defaultSubject |
default-subject |
Pre-fills the subject field in the form. | string |
'' |
to |
to |
Email address to send the form contents to. Defaults to feedback@boston.gov. | string |
'feedback@boston.gov' |
token |
token |
HTTP Authorization header token. Needs to match an API token in the contactform.boston.gov database. |
string |
'' |
visible |
visible |
Whether or not the modal is shown. Defaults to hidden. | boolean |
false |
hide() => void
Hide the modal.
Type: void
show() => void
Show the modal.
Type: void
Built with StencilJS