PHPackages                             machour/yii2-google-gmail - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. machour/yii2-google-gmail

ActiveYii2-extension[API Development](/categories/api)

machour/yii2-google-gmail
=========================

Data providers, widgets and helpers suited for the official GMail Api v1

3982PHP

Since Oct 24Pushed 10y agoCompare

[ Source](https://github.com/machour/yii2-google-gmail)[ Packagist](https://packagist.org/packages/machour/yii2-google-gmail)[ RSS](/packages/machour-yii2-google-gmail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-google-gmail
=================

[](#yii2-google-gmail)

Data providers, widgets and helpers suited for the official GMail Api v1.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist machour/yii2-google-gmail "*"

```

or add

```
"machour/yii2-google-gmail": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

**Displaying your latest threads in a grid**

Controller :

```
public function actionIndex()
{
    $pagination = new Pagination();
    $dataProvider = new GmailThreadDataProvider([
        // Service must be a Google_Service_Gmail instance
        // Here, machour/yii2-google-apiclient is used to get that instance
        'service' => Yii::$app->gmail->getService(),
        'pagination' => $pagination,
    ]);
    $pagination->totalCount = $dataProvider->getTotalCount();

    return $this->render('index', [
        'dataProvider' => $dataProvider
    ]);
}
```

View file :

```
use machour\yii2\google\gmail\widgets\GmailGridView;
use machour\yii2\google\gmail\helpers\GmailHelper as GH;
use yii\bootstrap\Html;

echo GmailGridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [
        [
            'attribute' => 'date',
            'value' => function ($thread, $key, $index, $widget) {
                /** @var Google_Service_Gmail_Thread $thread */
                return GH::getMessageHeader(GH::getThreadLastMessage($thread), 'Date');
            }
        ],
        [
            'attribute' => 'sender',
            'value' => function ($thread, $key, $index, $widget) {
                /** @var Google_Service_Gmail_Thread $thread */
                return GH::getThreadLastParticipant($thread);
            }
        ],
        [
            'attribute' => 'subject',
            'value' => function ($thread, $key, $index, $widget) {
                /** @var Google_Service_Gmail_Thread $thread */
                $subject = GH::getThreadSubject($thread);
                if (!$subject) {
                    $subject = '' . Yii::t('app', 'No subject') . '';
                }
                return $subject;
            },
            'format' => 'html',
        ],
        [
            'attribute' => 'Number of messages',
            'value' => function ($thread, $key, $index, $widget) {
                /** @var Google_Service_Gmail_Thread $thread */
                return GH::getThreadMessagesCount($thread);
            }
        ],
        [
            'attribute' => 'Actions',
            'value' => function ($thread, $key, $index, $widget) {
                /** @var Google_Service_Gmail_Thread $thread */
                return Html::a('View thread', ['gmail/thread', 'id' => $thread->getId()]);
            },
            'format' => 'html',
        ]

    ],
]);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/50430982793b695a5a9a886a81b976606c71062b49cf38c12509801b1845b1b2?d=identicon)[machour](/maintainers/machour)

---

Top Contributors

[![machour](https://avatars.githubusercontent.com/u/304450?v=4)](https://github.com/machour "machour (3 commits)")

### Embed Badge

![Health badge](/badges/machour-yii2-google-gmail/health.svg)

```
[![Health](https://phpackages.com/badges/machour-yii2-google-gmail/health.svg)](https://phpackages.com/packages/machour-yii2-google-gmail)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
