> For the complete documentation index, see [llms.txt](https://flutter-boilerplate.gitbook.io/flutter-boilerplate-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flutter-boilerplate.gitbook.io/flutter-boilerplate-docs/features/components/newsletter.md).

# Newsletter

The newsletter widget does automatically validates submitted emails and saves them in the Firestore database. The widget class is:

```dart
class NewsletterSignUp1
```

and the logic is in:

```dart
class NewsletterRepository
```

When an email is submitted the database structure looks like this

```dart
Collection: NEWSLETTER
    Document: [the submitted email]
        Content: {
                     'email': [the submitted email],
                     'timestamp': FieldValue.serverTimestamp()       
                 }
```
