Answers.Body: <p>I think there was a recent change that broke it. <a href="https://github.com/civicrm/civicrm-core/pull/22169" rel="nofollow noreferrer">This patch</a> was added to CiviCRM 5.44+ to fix it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-30T01:26:39.467Z
Answers.LastActivityDate: 2022-05-26T22:18:06.303Z
Answers.LastEditDate: 2022-05-26T22:18:06.303Z
Answers.UserDisplayName: Demerit
Body: <p>I'm trying to set up a mail account using OAuth following the instructions <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#adding-an-incoming-email-account-for-processing-bounces-andor-email-to-activities" rel="nofollow noreferrer">here</a> and <a href="https://civicrm.stackexchange.com/questions/38845/how-can-i-set-up-an-incoming-email-or-bounce-account-on-gmail-with-oauth/38846#38846">here</a>.</p>
  <p>I've set up OAuth in Administer &gt; System Settings &gt; OAuth:
  <a href="https://i.sstatic.net/pSJdG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pSJdG.png" alt="Screenshot showing confirmed Gmail OAuth connection" /></a></p>
  <p>But when I go to Administer &gt; CiviMail &gt; Mail Accounts I still just see the regular Add Mail Account button, not a drop down that allows me to choose and OAuth account:
  <a href="https://i.sstatic.net/Han9Q.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Han9Q.png" alt="Screenshot showing Add Mail Account button" /></a></p>
  <p>What have I missed?</p>
  <p><strong>Edit:</strong> Drupal 7.82 and CiviCRM 5.43.2.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-27T01:00:25.680Z
Comments.Text: I'm able to replicate this on CiviCRM 5.43.2 and Drupal 9
Comments.UserDisplayName: Luke Stewart
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-27T01:10:51.380Z
Comments.Text: Using the API4 explorer when I check OAuthProviders I don't see a mailSettingsTemplate -> https://fz-action.fudev.co.nz/civicrm/api4#/explorer/OAuthProvider/get?orderBy=%5B%5B%22name%22,%22ASC%22%5D%5D but I do on a site where this is working.
Comments.UserDisplayName: Luke Stewart
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-29T10:00:53.190Z
Comments.Text: I have no experience with the API. In the extensions manager it says API4 is obsolete. Is that related?
Comments.UserDisplayName: somnolentsurfer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-29T22:01:44.477Z
Comments.Text: Maybe - api4 was moved into a core extension. I'd uninstall it, then remove the folder where you have the old api4 extension. But it sounds like there's something else too.
Comments.UserDisplayName: Demerit
Tags: <email><oauth>
Title: Can't add Gmail account with OAuth
ThreadText: # Can't add Gmail account with OAuth
  
  (Asked by: username_0 on 2021-11-26)
  
  I'm trying to set up a mail account using OAuth following the instructions [here](https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/#adding-an-incoming-email-account-for-processing-bounces-andor-email-to-activities) and [here](https://civicrm.stackexchange.com/questions/38845/how-can-i-set-up-an-incoming-email-or-bounce-account-on-gmail-with-oauth/38846#38846).
  
  I've set up OAuth in Administer > System Settings > OAuth:
  [![Screenshot showing confirmed Gmail OAuth connection](https://i.sstatic.net/pSJdG.png)](https://i.sstatic.net/pSJdG.png)
  
  But when I go to Administer > CiviMail > Mail Accounts I still just see the regular Add Mail Account button, not a drop down that allows me to choose and OAuth account:
  [![Screenshot showing Add Mail Account button](https://i.sstatic.net/Han9Q.png)](https://i.sstatic.net/Han9Q.png)
  
  What have I missed?
  
  **Edit:** Drupal 7.82 and CiviCRM 5.43.2.
  
  **Tags:** email, oauth
  
  > **Comments:**
  > **username_1**: I'm able to replicate this on CiviCRM 5.43.2 and Drupal 9  
  > **username_1**: Using the API4 explorer when I check OAuthProviders I don't see a mailSettingsTemplate -> https://fz-action.fudev.co.nz/civicrm/api4#/explorer/OAuthProvider/get?orderBy=%5B%5B%22name%22,%22ASC%22%5D%5D but I do on a site where this is working.  
  > **username_0**: I have no experience with the API. In the extensions manager it says API4 is obsolete. Is that related?  
  > **username_2**: Maybe - api4 was moved into a core extension. I'd uninstall it, then remove the folder where you have the old api4 extension. But it sounds like there's something else too.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-11-30. Score: 3
  
  I think there was a recent change that broke it. [This patch](https://github.com/civicrm/civicrm-core/pull/22169) was added to CiviCRM 5.44+ to fix it.
  
  
  ---
  
  