Important

You are browsing documentation for version 5.0 of OroCommerce, OroCRM, and OroPlatform, maintained until August 2024 and supported until March 2026. See version 5.1 (the latest LTS version) of the Oro documentation for information on latest features.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Recipients Autocompletion

Add Additional Recipients in Autocompletion

  • create provider implementing Oro\Bundle\EmailBundle\Provider\EmailRecipientsProviderInterface
    • it has 2 methods
      • getSection
        • returns translation key of section in select where recipients from the provider will be placed
      • getRecipients
        • return associative array where key is email address and value is email address with name
        • its argument EmailRecipientsProviderArgs contains
          • relatedEntity - object from which email is being send
          • limit - maximum number of emails which should be returned from the provider
          • query - string writte by user when typing email address/name
          • excludedEmails - emails returned by previously executed providers
  • tag provider with the oro_email.recipients_provider tag

Useful Classes

  • Oro\Bundle\EmailBundle\Provider\RelatedEmailsProvider extracts emails from the given object and its relations
  • EmailRecipientsHelper helps to filter given emails