Validate email addresses in Flatfile data imports with format checking, required field validation, and disposable domain blocking
validateEmail
function.
string
'**'
'**'
means the plugin will run on all sheets in the workspace.string[]
string[]
[]
(empty array)object
required
: Message for a missing email value. Default: “Email is required”invalid
: Message for an improperly formatted email. Default: “Invalid email format”disposable
: Message for an email from a blocked domain. Default: “Disposable email addresses are not allowed”domain
: Not currently used by the pluginconfig
(object): A configuration object with the following properties:
sheetSlug
(string, optional): The slug of the sheet to target. Defaults to '**'
to target all sheets.emailFields
(string[], required): An array of field keys to validate.disposableDomains
(string[], optional): A list of domains to reject.errorMessages
(object, optional): An object for custom error messages.FlatfileListener
instance configured with the record hook, which can be passed to listener.use()
.
sheetSlug
in the configuration correctly matches the slug of your target Sheet.emailFields
array exactly match the field keys in your Sheet configuration.listener.use()
.errorMessages
are not provided, it uses its own internal messages for required, invalid, and disposable email errors. If disposableDomains
is not provided, it will not perform any disposable domain checks, only format and presence validation.
domain
key within the errorMessages
configuration object is defined in the type interface but is not currently used in the validation logic.FlatfileRecord
using the record.addError()
method.