Let's build a simple contact form for my site. I would like the form to include a name, an optional email and a message field. In HTML, it would look like that:
<form action="" method="post"> <div class="field"> <label for="name">Name</label> <input type="text" name="name" id="name" required> </div> <div class="field"> <label for="email">Email (optional)</label> <input type="email" name="email" id="email"> </div> <div class="field"> <label for="message">Message</label> <textarea name="message" style="height: 200px;" id="message" required></textarea> </div> <input type="submit" value="Submit"> </form>
You'll notice we haven't added an action URL to the form yet. When you login to Riku, you will be given your own URL that looks something like that:
The user_id part will be different for you. It tells Riku who you are, so that your requests arrive to you. Let's add it to our form:
<form action="https://riku.miso.town/submit?user_id=1" method="post"> ... </form>
From now on, you will be able to see all the messages on Riku.
If you'd like your user to be shown a custom page when the form is submitted, you can add a special redirect field to the form:
<input type="hidden" name="redirect" value="https://m15o.ichi.city/message-sent.html">
Riku will redirect the user there once the form data is captured.
If you are like me and use Riku in many places, a good practice is to label your requests to help you triage them. You do it by appending a query string parameter to your Riku URL:
Now all requests coming from the contact form will be labeled with "contact".
Riku provides an atom feed that you can find on the navigation bar at the top. Pass the feed to your feed reader of choice.