Skip to content

email

email fields operate similarly to a normal string field, but will only accept a valid email address.

Module field definition

javascript
// Configuring the `workEmail` field in a module's `fields.add` subsection:
workEmail: {
  label: 'Work email address',
  type: 'email'
}

Settings

Required

PropertyTypeDefaultDescription
labelStringSets the visible label for the field in the UI
typeStringSpecifies the field type (email for this type)

Optional

PropertyTypeDefaultDescription
helpStringn/aHelp text for the content editor
htmlHelpStringn/aHelp text with support for HTML markup
ifObject{}Conditions to meet before the field is active. See the guide for details.
requiredIfObject{}Conditions to meet before the field is required. See the guide for details.
requiredBooleanfalseIf true, the field is mandatory
readOnlyBooleanfalseIf true, prevents the user from editing the field value

Use in templates

nunjucks
Email: {{ data.piece.workEmail }}