fourlabs / gmail-doctrine-bundle
Doctrine Implementation of fourlabs/gmail-bundle
Installs: 1 670
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 2
Requires
- php: >=7.0
- doctrine/orm: ~2.5
- fourlabs/gmail-bundle: *.*@dev
- html2text/html2text: ^4.0.1
- symfony/config: ~2.8|~3.0|~3.1
- symfony/console: ~2.8|~3.0|~3.1
- symfony/dependency-injection: ~2.8|~3.0|~3.1
- symfony/doctrine-bridge: ~2.8|~3.0|~3.1
- symfony/form: ~2.8|~3.0|~3.1
- symfony/http-foundation: ~2.8|~3.0|~3.1
- symfony/http-kernel: ~2.8|~3.0|~3.1
- symfony/options-resolver: ~2.8|~3.0|~3.1
- symfony/routing: ~2.8|~3.0|~3.1
- symfony/validator: ~2.8|~3.0|~3.1
This package is auto-updated.
Last update: 2024-11-22 07:45:50 UTC
README
GmailDoctrineBundle provides you a Doctrine implementation of GmailBundle.
Installation
$ composer require fourlabs/gmail-doctrine-bundle
Configuration
// app/config/config.yml
fl_gmail_doctrine:
sync_setting_class: TriprHqBundle\Entity\GmailSyncSetting
Setup
- Create doctrine entities in your entities folder e.g.
AppBundle\Entity
. - These entities must extend all the MappedSuperClasses in this bundle's
Entity
folder. - Make sure you use the provided repositories (from the entity folder). Or extend the repositories.
<?php namespace AppBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; use FL\GmailDoctrineBundle\Entity\SyncSetting; /** * @ORM\Entity(repositoryClass="FL\GmailDoctrineBundle\Entity\SyncSettingRepository") */ class GmailSyncSetting extends SyncSetting { }
Why GmailDoctrineBundle?
- A sync command that lets you sync gmailIds, gmailMessages, or both. i.e. with two options:
- Example
php bin/console fl:gmail_doctrine:sync --mode=both --limit_messages_per_user=100
. - Required Option
mode
: Can begmail_ids
,gmail_messages
, orboth
. - Option
limit_messages_per_user
: Required formode=gmail_ids
ormode=both
. Must be a positive integer. - Suggestion: allow enough space between syncs so that you don't sync the same messages twice. Messages won't be saved to the database twice, but you might experience throttling.
- Note: Messages are requested in batch, 45 at a time. Each batch request takes about 2 seconds.
- Suggestion: Set a limit of 315 message per user.
7 batches * 2 seconds per batch = 14 seconds
. This means you must leave at least14 * number of users
seconds between requests. - Note: Before running the sync for
both
, make sure to run the sync forgmail_ids
at least once.
- Example
- Event Listeners, that will save what we fetch from Google into the database. See more at the
EventListener
folder. FL\GmailDoctrineBundle\Entity\SyncSetting
entity:- Allows you to pick which email inboxes you want to sync, and send email from.
- See corresponding form,
FL\GmailDoctrineBundle\Form\Type\SyncSettingType
.
FL\GmailDoctrineBundle\Model\OutgoingEmail
model class:- Represents an Outgoing Email.
- See corresponding form,
FL\GmailDoctrineBundle\Form\Type\OutgoingEmailType
. - From field, according to what you have enabled through
FL\GmailDoctrineBundle\Entity\SyncSetting
.
FL\GmailDoctrineBundle\Services\GoogleClientStatusWrapper
is a wrapper forFL\GmailBundle\Services\GoogleClientStatus
.- Copies the authentication method,
GoogleClientStatusWrapper::isAuthenticated
. - And two more methods
GoogleClientStatusWrapper::isSetupForDomain(string $domain)
andGoogleClientStatusWrapper::isSetupForAtLeastOneDomain()
- Copies the authentication method,
License
GmailDoctrineBundle is licensed under the MIT license.