GithubHelp home page GithubHelp logo

dheia / wn-gmaildriver-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zaxbux/wn-gmaildriver-plugin

0.0 0.0 0.0 92 KB

Send email with Gmail using this driver plugin for Winter CMS

License: MIT License

PHP 78.54% HTML 21.46%

wn-gmaildriver-plugin's Introduction

Gmail Mailer Driver

Send email with Gmail using this driver plugin for Winter CMS.

Installing

composer require zaxbux/wn-gmaildriver-plugin

Requirements

  • A Gmail account. Google Workspace (G Suite) accounts are also supported, if your administrator has enabled access.
  • Gmail API credentials (see below).

Plugin Settings

The plugin is configured in your backend settings. Change the mail method to Gmail in Mail configuration, save the settings and go to Gmail configuration to upload your API credentials. Obtain API credentials from the Google Cloud Console.

Obtaining API Keys

Read instructions on obtaining API keys

Testing delivery

To make sure everything is working, try test sending a mail template to yourself.

Revoking access

In case you want to revoke access, click Reset to default on the Gmail configuration page. This will delete the credentials and access tokens. You may also want to remove app access on your Google account.

Important Notes

  • The Gmail API will only send emails as the account which you granted access with, it is currently not possible to send email as another user.
  • You can send email using another email address you own, using an alias. Learn more. Change the Sender name and Sender email in Mail configuration to match your alias.

Advanced Usage

This section is for advanced users.

Note: To avoid overwriting your custom configuration with plugin updates, copy the provided config.php to the Winter CMS config directory: config/zaxbux/gmaildriver/config.php.

Providing credentials

To provide the OAuth credentials without uploading them through the backend UI, you can add them in the plugin's config.php file. This is useful if you want to provide credentials using an environment variable. By default, the contents of the GOOGLE_APPLICATION_CREDENTIALS_JSON environment variable will be used.

Example:

    'credentials' => '{"web": {"client_id": "000000000000-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.apps.googleusercontent.com", ... }}',

Authentication Scopes

To change the authentication scopes (permissions requested from the user), you can override the default scopes in the plugin's config.php file. Add scopes to the google.scopes array. For the plugin to function correctly, the gmail.send scope is required. Gmail Auth Scopes

Example:

    'scopes' => [
        \Google_Service_Gmail::GMAIL_SEND,
        \Google_Service_Gmail::GMAIL_READONLY,
    ],

Change Log

  • 1.0.15 - Fixed migration to Winter (@mjauvin)
  • 1.0.14 - Removed requirement to upload JSON file, client secret is now encrypted in DB.
  • 1.0.13 - Added Gmail alias documentation, added ability to pass credentials via environment vars.
  • 1.0.12 - Improve UI.
  • 1.0.11 - Increased max sending size to 35MB (encoded message size).
  • 1.0.10 - Added ability to change auth scopes used with the Google API client.
  • 1.0.9 - Improved localization.
  • 1.0.8 - Plugin requires elevated permissions to function on restore password page.
  • 1.0.7 - Added settings permissions
  • 1.0.6 - Added authorization status dashboard widget.
  • 1.0.5 - Cleaned up Gmail API authorization flow.
  • 1.0.4 - Fixed issue where backend authorization status showed expired when it was authorized.
  • 1.0.3 - Fixed logic issues, app is removed from user account when settings are reset. Updated dependencies.
  • 1.0.2 - Fixed errors that occur when invalid credentials are supplied.
  • 1.0.1 - First version.

Acknowledgments

  • @alxy - Increased max sending size to 35MB.

wn-gmaildriver-plugin's People

Contributors

alxy avatar dependabot[bot] avatar mjauvin avatar zaxbux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.