{"id":19810309,"url":"https://github.com/fourlabsldn/gmailbundle","last_synced_at":"2025-07-04T11:02:16.412Z","repository":{"id":62506760,"uuid":"70251410","full_name":"fourlabsldn/GmailBundle","owner":"fourlabsldn","description":"Gmail API Wrapper for Symfony","archived":false,"fork":false,"pushed_at":"2020-03-21T21:58:20.000Z","size":143,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T11:33:32.085Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fourlabsldn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-07T13:54:10.000Z","updated_at":"2018-08-01T16:01:39.000Z","dependencies_parsed_at":"2022-11-02T12:30:46.145Z","dependency_job_id":null,"html_url":"https://github.com/fourlabsldn/GmailBundle","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourlabsldn%2FGmailBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourlabsldn%2FGmailBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourlabsldn%2FGmailBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourlabsldn%2FGmailBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fourlabsldn","download_url":"https://codeload.github.com/fourlabsldn/GmailBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251847791,"owners_count":21653580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T09:20:43.014Z","updated_at":"2025-05-01T08:31:51.379Z","avatar_url":"https://github.com/fourlabsldn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GmailBundle\n\n[![StyleCI](https://styleci.io/repos/70251410/shield?branch=master)](https://styleci.io/repos/70251410)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/2113fe3d-8256-4009-8d0c-8a84f21a7b59/mini.png)](https://insight.sensiolabs.com/projects/2113fe3d-8256-4009-8d0c-8a84f21a7b59)\n\nGmailBundle allows you to manage a Google Apps domain's inboxes (you can pick which). In order to do this, \nyou must authorize a [service account with domain wide delegation](https://console.developers.google.com/iam-admin/serviceaccounts/serviceaccounts-zero)\n\n## Installation\n\n```bash\n    $ composer require fourlabs/gmail-bundle\n```\n\n## Configuration\n\n```yaml\n// app/config/config.yml\nfl_gmail:\n    admin_user_email: tech@slv.global\n    json_key_location: /var/www/symfony/app/config/service_account_private_key.json\n    gmail_message_class: \\AppBundle\\Entity\\GmailMessage\n    gmail_label_class: \\AppBundle\\Entity\\GmailLabel\n    gmail_history_class: \\AppBundle\\Entity\\GmailHistory\n    gmail_ids_class: \\AppBundle\\Entity\\GmailIds\n    \nswiftmailer:\n    default_mailer: general_mailer\n    mailers:\n        general_mailer:\n            transport: \"%mailer_transport%\"\n            host:      \"%mailer_host%\"\n            username:  \"%mailer_user%\"\n            password:  \"%mailer_password%\"\n            spool:     { type: memory }\n        fl_gmail_api_mailer:\n            transport: fl_gmail.swift_transport\n```\n\n#### Syncing Gmail Ids (i.e. Which emails need to be synced?)\n`FL\\GmailBundle\\Services\\SyncGmailIds`\n- Takes a `$userId` parameter. \n- Gets a list of all the Gmail Ids, or the subset of Gmail Ids according to a history Id.  [What is a history Id?](https://developers.google.com/gmail/api/guides/sync)\n- Dispatches `FL\\GmailBundle\\Event\\GmailSyncIdsEvent` with a list of all the new / updated ids. (Updated Gmail Ids = change of label)\n- It is your responsibility to save the Gmail Ids coming from this event.\n- Dispatches `FL\\GmailBundle\\Event\\GmailSyncHistoryEvent`, such that next time, you can perform a Partial Sync. [What is a Partial Sync?](https://developers.google.com/gmail/api/guides/sync)\n- It is your responsibility to save the History Id coming from this event.\n\n#### Syncing Messages using Gmail Ids (i.e. I know which emails need to be synced, let's fetch them.)\n`FL\\GmailBundle\\Services\\SyncMessages`\n- This service, takes a list of gmail ids and resolves all the new/updated messages for you. \n- I.e. use the ids you are fetching from `FL\\GmailBundle\\Services\\SyncGmailIds`\n- Dispatches `FL\\GmailBundle\\Event\\GmailSyncMessagesEvent`.\n- It is your responsibility to save the Gmail Messages coming from this event.\n- It is your responsibility to remove the newly synced Gmail Ids, you had previously saved with `FL\\GmailBundle\\Services\\SyncGmailIds`.\n\n#### All this responsibility? :cry: :sob:\n\nWhy are there so many `It is your responsibility` statements? Because this bundle is storage agnostic. But don't fret! There \nis a [GmailDoctrineBundle](https://github.com/fourlabsldn/GmailDoctrineBundle) that implements all of this in Doctrine for you. \n\n### How do I dive into this bundle?\n\n- Start by looking into the `Model` classes.\n- To understand the services, have a look at `Resources/config/services.yml`.\n\n### What else is going on?\n\n- You can send swiftmailer emails through `FL\\GmailBundle\\Swift\\GmailApiTransport`. Simply make sure the from is in your domain.\n- `FL\\GmailBundle\\Form\\Type\\InboxType` contains a choice type, with all the inboxes in the authenticated domain.\n\n## License\n\nGmailBundle is licensed under the MIT license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffourlabsldn%2Fgmailbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffourlabsldn%2Fgmailbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffourlabsldn%2Fgmailbundle/lists"}