<aside> 👉 Links (Property base class)

ButtonProperty

CheckboxProperty

CreatedByProperty

CreatedTimeProperty

DateProperty

EmailProperty

FilesProperty

FormulaProperty

MultiSelectProperty

LastEditedByProperty

LastEditedTimeProperty

NumberProperty

PeopleProperty

PhoneNumberProperty

Property

RelationProperty

RichTextProperty

RollupProperty

SelectProperty

StatusProperty

TitleProperty

UniqueIdProperty

UrlProperty

VerificationProperty

Notion Ruby Mapping Public API Reference

</aside>

<aside> 💡

[P] means methods for Page Property, [DB/DS] means methods for Database or DataSource Property.

</aside>

1. Instance methods

[P/DB/DS] email → String, Hash, nil

  1. email of Page property returns the email address value.

  2. email of Page property returns nil when the email address is empty.

  3. email of Database or DataSource property returns the schema Hash. For Email property, it is an empty Hash {}.

    page.properties["MailTitle"].email
    # => "[email protected]"
    
    page.properties["MailTitle"].email
    # => nil
    
    ds.properties["MailTitle"].email
    # => {}
    

[P] email=(value)

  1. email=(value) of Page property sets the email address value and sets will_update_flag to true.

  2. email = nil clears the email address value.

  3. email = "" keeps an empty string as-is. It is not converted to nil by NotionRubyMapping.

  4. email=(value) of Database or DataSource property raises StandardError.

    page.properties["MailTitle"].email = "[email protected]"
    # => "[email protected]"
    
    page.properties["MailTitle"].email = nil
    # => nil
    
    page.properties["MailTitle"].email = ""
    # => ""
    
    ds.properties["MailTitle"].email = "[email protected]"
    # ...:in `assert_page_property': email= can execute only Page property. (StandardError)
    

Email filters

The methods below return a Query without sending an API request or changing the email value. They are available on Page, Database and DataSource property objects; query examples use DataSource properties. The examples show the generated Hash through Query#filter, not search results.

For ordinary Email filters, omit condition: and another_type: (both default to nil). The shared implementation accepts them for Formula / Rollup use, but they are not needed for an Email condition. Use filter_is_empty / filter_is_not_empty for empty-value searches rather than passing nil as a string comparison value.

[DB/DS] filter_contains(value) → Query

Creates a Query that matches email addresses containing the given substring.

ds.properties["MailTitle"].filter_contains("example").filter
# => {"property" => "MailTitle", "email" => {"contains" => "example"}}