id: d7_simplenews_subscribers
migration_group: d7_materio
dependencies:
  # config:
  #   - migrate.migration.d7_simplenews_newsletter
  module:
    - migrate_drupal
    - simplenews
label: Simplenews subscribers
migration_tags:
  - Drupal 7
  - Content
  - Materio

source:
  plugin: d7_simplenews_subscribers
  # high_water_property:
  #   name: changes
  #   alias: s

process:
  id: snid
  status: activated
  mail: mail
  # uid: uid
  uid:
    plugin: migration_lookup
    migration: d7_users
    source: uid
    no_stub: true

  langcode: language
  changes: changes
  created: created

  subscriptions:
    plugin: iterator
    source: subscriptions
    process:
      target_id:
        plugin: static_map
        source: newsletter_id
        map:
          6585: "test"
          6374: "ze_daily_materio_"
          6274: "materio_newsletter"
          7881: "companies"
        # plugin: migration
        # migration: d7_simplenews_newsletter
        # source: newsletter_id
      status: status
      timestamp: timestamp
      source: source

destination:
  plugin: entity:simplenews_subscriber

migration_dependencies:
  required:
    - d7_users
