dev/core#2141 - "Add Mail Account" - Allow hookable listing of setup links #18885
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
For certain types of mail accounts -- such as Google Mail and Microsoft Exchange Online -- the setup process may require interaction with a remote web-service. The web-service provides some critical details (like authentication tokens) and some handy details (like their username / email address).
If the site supports one of these services, then this revision will enable a setup process. It alters the "Add Mail Account" action to use a more fine-tuned procedure.
This is a part of the larger epic #18863.
Before
Steps:
After
By default, the UX is the same. However, if you have an extension like
oauth-client
, then it changes:Steps:
Technical Details
This defines a new hook,
hook_civicrm_mailSetupActions
, e.g.For standard mail accounts, 'the-next-setup-page' is just the normal/existing page. For an OAuth2-based provider like Microsoft, it is the OAuth2 URL. There is an implementation of the hook in #18863 (under
ext/oauth-client
) -- e.g. theoauth_client_civicrm_mailSetupActions
delegates to CRM_OAuth_MailSetup and ultimately loads the mail config from ms-exchange.dist.jsonComments
In the basic/default layout, there is the "Add Mail Account" button and also a "Done" button. The "Done" button is weird. But I left it in the basic/default layout because it's hard to prove that it's weird.