Problem

We have quite a few places where we have a subject and body configuration field (e.g. social_event_an_enroll.schema.yml) but there's no relationship between the two (even though they should be used together).

Drupal core offers a mail config type (defined in core.data_types.schema.yml). Using this type would provide more context to consumers that these values should always be used together. By using this config schema, we are also able to use the email field widget. This also makes it easier to make these e-mails translatable.

Solution

Identify the places in Open Social where these mail fields are created. For each identified site:

  • Change the schema and default configuration.
  • Provide an update hook to transform current configuration to the new schema
  • Update all calling sites to use the new configuration form. For configuration forms, move over to the email type (example in Drupal core's AccountSettingsForm class)
  • Make the e-mail translatable (see AccountSettingsForm class for example).

These changes should be made in a major version because they could be a breaking change for contributed code.

An example of how this type is used can be seen in the user.mail config object (schema defined in core/modules/user/config/schema/user.schema/yml).

Comments

Kingdutch created an issue. See original summary.

kingdutch’s picture

Issue summary: View changes
kingdutch’s picture

Issue tags: +translations