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
requiredBooleanfalseIf true, the field is mandatory
readOnlyBooleanfalseIf true, prevents the user from editing the field value

Use in templates

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