Google mail with Oauth on Actionmailer

Hi all, Im facing a trouble that I don’t know how to solve it. Google send me a email to tell me that plain authentification for smtp will be no more support. My rails app receive a callback from wordpress website, create a licence and send it to the my customer with this actionmailer

class LicenceMailer < ApplicationMailer default from: licence@mydomain.com self.smtp_settings = { address: ‘smtp.gmail.com’, port: 587, domain: ‘http://mydomain.com’, user_name: licence@mydomain.com, password: secret_password, authentication: ‘plain’, enable_starttls_auto: true }

the email from google is Starting September 30, 2024, Google Workspace accounts will only allow access to apps using OAuth. Password-based access (with the exception of App Passwords) will no longer be supported. POP and IMAP are NOT going away and can still be enabled with apps that connect using OAuth. … Im trying to use Oauth with chatgpt and claude but didn’t achiev anything. Please help

We had this issue too and it surprises me that no one seems to be talking about or having this problem.

We managed to make it work but we had to skip active_mailer altogether and use a combination of gmail_xoauth with some custom code.

If someone find an easier way i would like to known about it otherwise we might try to open source our findings