<commit_before>/* @flow */
import NotificationCatcherProvider from '../notificationCatcherProvider'
// Types
import type { EmailRequestType } from '../../models/notification-request'

export default class EmailNotificationCatcherProvider extends NotificationCatcherProvider {
  async send (request: EmailRequestType): Promise<string> {
    const { to, from, html, text, subject, replyTo } =
      request.customize ? (await request.customize(this.id, request)) : request
    return this.sendToCatcher({
      to,
      from,
      html,
      text,
      subject,
      replyTo,
      headers: {
        'X-to': `[email] ${to}`
      }
    })
  }
}<commit_msg>support email attachments for catcher (#86)<commit_after>/* @flow */
import NotificationCatcherProvider from '../notificationCatcherProvider'
// Types
import type { EmailRequestType } from '../../models/notification-request'

export default class EmailNotificationCatcherProvider extends NotificationCatcherProvider {
  async send (request: EmailRequestType): Promise<string> {
    const { to, from, html, text, subject, replyTo, attachments } =
      request.customize ? (await request.customize(this.id, request)) : request
    return this.sendToCatcher({
      to,
      from,
      html,
      text,
      subject,
      replyTo,
      attachments,
      headers: {
        'X-to': `[email] ${to}`
      }
    })
  }
}
{'fraction_non_alphanumeric': 0.11939218523878437, 'fraction_numerical': 0.001447178002894356, 'mean_word_length': 3.1160714285714284, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6190863', 'n_tokens_mistral': 396, 'n_tokens_neox': 381, 'n_words': 101}