Skip to content

Instantly share code, notes, and snippets.

@garethredfern
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garethredfern/e0d5dc639334c38bacbf to your computer and use it in GitHub Desktop.
Save garethredfern/e0d5dc639334c38bacbf to your computer and use it in GitHub Desktop.
Raven new job formset example for Statamic.
###########################################################################################
#
# NEW JOB RAVEN FORMSET
#
# Formsets can override any default settings (raven.yaml) EXCEPT master_killswitch
#
###########################################################################################
# Location (from root) to save form submissions
submission_save_path: _content/_jobs/
filename_format: "{{ year }}-{{ month }}-{{ day }}-{{ customer_username }}-{{ title|lower|slugify }}"
# Fields allowed to be submitted in the form, automatically
# purging anything and everything else
allowed:
- title
- job_address
- description
- customer_uid
- customer_username
- contractor_name
- contractor_email
- contractor_telephone
- contractor_address
- agreed_price
- pay_contractor
- completion_date
- payment_type
- contractor_payment
# You are not required to require fields, but once you do, any missing
# from the POST will squash this submission and send a list of
# missing fields to your {{ raven:errors }} tagpair
required:
- title
- job_address
- description
- customer_uid
- customer_username
- contractor_name
- contractor_email
- contractor_address
- agreed_price
- completion_date
- payment_type
submission_save_extension: md
# Apply validation rules to specific fields. Refer to documentation
# for a full list of available rules and their format
validate:
contractor_email: email
agreed_price:
positive: true
messages:
contractor_email: "Your email address must be a valid one."
agreed_price: "Needs to be a positive number with no £ symbol."
# Configure notification email
send_notification_email: true
email:
to: example@example.com
from: example@example.com
subject: New Job Posted
automagic: false
html_template: html_email
text_template: text_email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment