{"id":37014793,"url":"https://github.com/alvlapo/phalcon-mailer","last_synced_at":"2026-01-14T01:28:49.710Z","repository":{"id":56955310,"uuid":"150764122","full_name":"alvlapo/phalcon-mailer","owner":"alvlapo","description":"Mailer wrapper over SwiftMailer and View component for Phalcon.","archived":false,"fork":false,"pushed_at":"2019-01-18T14:45:55.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-11T19:48:01.834Z","etag":null,"topics":["mailer","phalcon","phalcon-framework","phalconphp","swiftmailer"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alvlapo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-28T16:01:19.000Z","updated_at":"2019-10-15T02:14:23.000Z","dependencies_parsed_at":"2022-08-21T04:10:56.780Z","dependency_job_id":null,"html_url":"https://github.com/alvlapo/phalcon-mailer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alvlapo/phalcon-mailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvlapo%2Fphalcon-mailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvlapo%2Fphalcon-mailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvlapo%2Fphalcon-mailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvlapo%2Fphalcon-mailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvlapo","download_url":"https://codeload.github.com/alvlapo/phalcon-mailer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvlapo%2Fphalcon-mailer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mailer","phalcon","phalcon-framework","phalconphp","swiftmailer"],"created_at":"2026-01-14T01:28:49.014Z","updated_at":"2026-01-14T01:28:49.691Z","avatar_url":"https://github.com/alvlapo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phalcon-mailer\nMailer wrapper over [SwiftMailer](https://swiftmailer.symfony.com/) for [Phalcon framework](https://phalconphp.com/).\n\n## Usage\n\n### Configuration\n\nThere are [several types of Transport](https://swiftmailer.symfony.com/docs/sending.html#transport-types) in Swift Mailer,\nyou create a Transport, use it to create the Manager, then you use the Manager to send the mail.\n\n```php\n$transport = new \\Swift_SendmailTransport();\n$view = \\Phalcon\\Di::getDefault()-\u003egetShared('view');\n\n$mailer = new \\Rotoscoping\\Phalcon\\Manager($transport, $view);\n\n// Add mailer to container (optional)\n\\Phalcon\\Di::getDefault()-\u003esetShared('mailer', $mailer);\n```\n\n### Sending the Email\n\n```php\n// Get mailer from DI\n$mailer = \\Phalcon\\Di::getDefault()-\u003eget('mailer');\n\n// Compose mail\n$mailer\n  -\u003eto('test@test.com')\n  -\u003esubject('Simple subject')\n  -\u003etext('Simple text part message')\n  -\u003esend();\n  \n// Fin\n```\n### Configuring The Sender\n\nThere are two ways to configure the sender. \n\nFirst, you may use the **from** method within your Mail class' build method:\n\n```php\n// You must initialize and add Manager instance to DI as 'mailer' service (see above)\n// or extend Mail class and owerride method getMailerInstance()\n\n$mail = new Mail();\n$mail\n  -\u003efrom('support@example.com', 'Support team')\n  -\u003eto('test@test.com')\n  -\u003esubject('Simple subject')\n  -\u003etext('Simple text part message');\n  \n$mail-\u003esend();\n```\n\nInstead, you may specify a global \"from\" address throw draft mail in your Manager instance. \nThis address will be used by default for all you mails:\n\n```php\n$defaultMail = new Mail();\n$defaultMail\n  -\u003efrom('support@example.com', 'Support team');\n\n// Get mailer from DI (see initializatio section)\n$mailer = \\Phalcon\\Di::getDefault()-\u003eget('mailer');\n\n$mailer-\u003esetDraftMail($defaultMail);\n\n$mail = new Mail();\n$mail\n  -\u003eto('test@test.com')\n  -\u003esubject('Simple subject')\n  -\u003etext('Simple text part message');\n  \n$mail-\u003esend();\n```\n\n## Example\n\n### Sending a message from the template\n```php\n// Initialize manager with mail and view services from DI\n$mailer = new \\Rotoscoping\\Phalcon\\Manager('mail', 'view');\n\n// template email_confirmation.phtml in your viewDir\n$mailer-\u003esend(\n  // view path\n  'email_confirmation',\n  // Swift params\n  [\n    'subject' =\u003e 'Example email confirmation',\n    'from' =\u003e 'no-reply@example.com',\n    'to' =\u003e 'user@mail.com'\n  ],\n  // View params\n  [ \n    'username' =\u003e 'User Name',\n    'token' =\u003e 'aq1sw2de3'\n  ]\n);\n```\n### Sending a message from the template via a magic method call\n```php\n// word of the send from the beginning and the template filename in camelCase notation\n$mailer-\u003esendEmailConfirmation(\n  [\n    'subject' =\u003e 'Example email confirmation',\n    'from' =\u003e 'no-reply@example.com',\n    'to' =\u003e 'user@mail.com'\n  ],\n  [\n    'username' =\u003e 'User Name',\n    'token' =\u003e 'aq1sw2de3'\n  ]\n);\n```\n\n## Sending with a Mailable\n\nUsing mailable classes are a lot more elegant than the basic usage example above.\nBuilding up the mail in a mailable class cleans up controllers and routes, making things look a more \ntidy and less cluttered as well as making things so much more manageable.\n\nAll of a mailable class' configuration is done in the **compose** method. Within this method, \nyou may call various methods such as **from**, **subject**, **view**, and **attach** to configure the email's \npresentation and delivery.\n\nMailable classes are required to extend the base Rotoscoping\\Phalcon\\Mailer\\Mailable class;\n\n## Inspired by\n* [mailer-library](https://github.com/2amigos/mailer-library)\n* [slim3-mailer](https://github.com/andrewdyer/slim3-mailer)\n* [mailer-library](https://github.com/2amigos/mailer-library)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvlapo%2Fphalcon-mailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvlapo%2Fphalcon-mailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvlapo%2Fphalcon-mailer/lists"}