{"id":17343452,"url":"https://github.com/firesphere/silverstripe-mailjet-mailer","last_synced_at":"2025-09-05T02:11:09.783Z","repository":{"id":65557593,"uuid":"594665202","full_name":"Firesphere/silverstripe-mailjet-mailer","owner":"Firesphere","description":"Send emails from Silverstripe Framework via Mailjet","archived":false,"fork":false,"pushed_at":"2023-10-29T00:55:09.000Z","size":35,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T04:05:56.209Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Firesphere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-29T08:55:46.000Z","updated_at":"2023-01-29T08:56:52.000Z","dependencies_parsed_at":"2025-02-01T14:30:43.651Z","dependency_job_id":"008f8277-010e-4413-a345-afe6e27c1014","html_url":"https://github.com/Firesphere/silverstripe-mailjet-mailer","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"d39e37e4ed439a09ec372faa289f7fc67f0b00ea"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Firesphere/silverstripe-mailjet-mailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-mailjet-mailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-mailjet-mailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-mailjet-mailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-mailjet-mailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firesphere","download_url":"https://codeload.github.com/Firesphere/silverstripe-mailjet-mailer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-mailjet-mailer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261233206,"owners_count":23128197,"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-10-15T16:09:26.525Z","updated_at":"2025-06-22T04:05:56.580Z","avatar_url":"https://github.com/Firesphere.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Silverstripe Mailjet Mailer \n\n[GPL v3 or later](LICENSE.md)\n\nSimple mailer module that uses Mailjet API to send emails.\n\n## Requirements\n\n* silverstripe/cms ^4.3.x\n* silverstripe/framework ^4.3.x\n* mailjet/mailjet-apiv3-php \"^1.5.8\n\n## Installation\n\n```bash\ncomposer require firesphere/mailjet-mailer\n```\n\n## Configuration\n\nAdd the following to your `.env`:\n\n```dotenv\nSS_MAILJET_KEY=\"YOURMAILJETKEY\"\nSS_MAILJET_SECRET=\"YOURMAILJETSECRET\"\n```\n\n## Usage\n\nSimply use the Email class provided by SilverStripe framework:\n\n```php\n$email = new SilverStripe\\Control\\Email\\Email();\n$email-\u003esetFrom('from@example.com', 'John Doe');\n$email-\u003esetTo('to@example.com', 'Jane Doe');\n$email-\u003esetSubject('This is a test email');\n$email-\u003esetBody('Hello there, this was sent using Mailjet');\n$email-\u003eaddAttachment('path/to/file.pdf', 'document.pdf');\n$email-\u003esend();\n```\n\nThat should be all there is to it.\n\n### DEV usage\n\nIf, in dev mode, you still want to use the Mailjet Mailer, but\nnot want to send actual emails, set the `send` flag to `false`\n\nVia PHP:\n```php\nnew \\Firesphere\\Mailjet\\Service\\MailjetMailer(false);\n```\nor\n```php\n$mailer = (new \\Firesphere\\Mailjet\\Service\\MailjetMailer())-\u003esetSend(false);\n```\n\nVia YML:\n```yaml\nSilverStripe\\Core\\Injector\\Injector:\n  Firesphere\\Mailjet\\Service\\MailjetMailer:\n    constructor:\n      - false\n```\n\n### Use SandboxMode\n\nAnother option to avoid emails actively being sent, is using SandboxMode.\n\nThis will go through the entire process of Mailjet, except that Mailjet will not\nactively send the emails, but respond as if it did.\n\nWays to set Sandbox mode:\n\n```php\n$mailer = (new \\Firesphere\\Mailjet\\Service\\MailjetMailer())-\u003esetSandbox(true);\n```\n\n```yaml\nSilverStripe\\Core\\Injector\\Injector:\n  Firesphere\\Mailjet\\Service\\MailjetMailer:\n    constructor:\n      - true\n      - true   \n```\n\n## Advanced usage\n\nMailjet allows to send multiple emails in a single request.\nTo do this, use the MailjetMailer directly and give it an array of Email objects.\n\nE.g.\n\n```php\n$mails = [\n    $mail1 = Email::create('to@example.com', 'from@example.com', 'Subject', 'Body'); // \n    $mail2 = Email::create('to@example.com', 'from@example.com', 'Subject', 'Body'); // \n];\n\n(new \\Firesphere\\Mailjet\\Service\\MailjetMailer())-\u003esend($mails);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiresphere%2Fsilverstripe-mailjet-mailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiresphere%2Fsilverstripe-mailjet-mailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiresphere%2Fsilverstripe-mailjet-mailer/lists"}