{"id":21045161,"url":"https://github.com/fullpipe/email-template-bundle","last_synced_at":"2025-08-22T13:12:22.195Z","repository":{"id":26242993,"uuid":"29689953","full_name":"fullpipe/email-template-bundle","owner":"fullpipe","description":null,"archived":false,"fork":false,"pushed_at":"2015-02-16T08:49:11.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T17:36:06.084Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/fullpipe.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":"2015-01-22T17:10:36.000Z","updated_at":"2015-02-16T08:49:12.000Z","dependencies_parsed_at":"2022-08-26T17:30:55.302Z","dependency_job_id":null,"html_url":"https://github.com/fullpipe/email-template-bundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Femail-template-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Femail-template-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Femail-template-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fullpipe%2Femail-template-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fullpipe","download_url":"https://codeload.github.com/fullpipe/email-template-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243489835,"owners_count":20299001,"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-19T14:20:20.086Z","updated_at":"2025-03-13T22:12:21.846Z","avatar_url":"https://github.com/fullpipe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About EmailTemplateBundle\nKeep email templates in repo and in order.\n## Installation\nFirst you need to add `fullpipe/email-template-bundle` to `composer.json`:\n```json\n{\n   \"require\": {\n        \"fullpipe/email-template-bundle\": \"dev-master\"\n    }\n}\n```\nYou also have to add `EmailTemplateBundle` to your `AppKernel.php`:\n```php\n// app/AppKernel.php\nclass AppKernel extends Kernel\n{\n    //...\n    public function registerBundles()\n    {\n        $bundles = array(\n            //...\n            new Fullpipe\\ImageBundle\\FullpipeImageBundle()\n        );\n\n        return $bundles;\n    }\n    //...\n}\n```\n## Configuration\n```yaml\nfullpipe_email_template:\n    # default from email\n    from: # or simply from: noreply@example.com\n        email: noreply@example.com\n        name: noreply\n\n    # default no reply email\n    reply_to: # or simply reply_to: reply@example.com\n        email: reply@example.com\n        name: We are waiting for your reply\n\n    # default utm-marks for links in emails (optional)\n    utm:\n        utm_source: source_test\n        utm_medium: medium_test\n        utm_campaign: campaign_test\n\n    # default host for which utm-marks will be applied\n    host: %router.request_context.scheme%://%router.request_context.host%\n    \n    # Your templates\n    # requires at least one template\n    templates:\n        default: # template name\n            # template uri\n            template: \"FullpipeEmailTemplateBundle:Template:default.html.twig\" \n\n            # custom utm-marks (optional)\n            utm: \n                utm_source: source_default\n                utm_medium: medium_default\n                utm_campaign: campaign_default\n\n            # custorm host (optional)\n            host: http://example.com\n\n            # generate text version automatically, true by default\n            generate_text_version: true\n        #...\n```\n## Usage\nFor example we need to send confirmation email, after user registration.\nFirst, we need to add template config:\n```yaml\nfullpipe_email_template:\n    #...\n    templates:\n        reg_confirmation:\n            template: \"AcmeWebBundle:EmailTemplates:reg_confirmation.html.twig\"\n            utm: \n                utm_source: reg_confirmation\n                utm_medium: email\n```\nSecond, we need to create `AcmeWebBundle:EmailTemplates:reg_confirmation.html.twig`:\n```twig\n{% block subject %}Good to you, {{ username }}{% endblock %}\n{% block body_html %}\n    \u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"\u003e\n    \u003chtml\u003e\n        \u003chead\u003e\n            \u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u003e\n            \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/\u003e\n            \u003cstyle type=\"text/css\"\u003e\n                ...\n            \u003c/style\u003e\n        \u003c/head\u003e\n        \u003cbody\u003e\n            \u003ch1\u003eHello, {{ username }}\u003c/h1\u003e\n            \u003cp\u003eLorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam deserunt magni libero quas aperiam, labore harum, eos expedita, dolores autem illum? Fugiat, molestias, minus. Libero impedit fugit inventore, aliquid perspiciatis.\u003c/p\u003e\n        \u003c/body\u003e\n    \u003c/html\u003e\n{% endblock %}\n```\nAnd we could send our email:\n```php\n    $this-\u003eget('fullpipe_email_template.mailer')\n        -\u003eprepareMessage('reg_confirmation', array('username' =\u003e 'USERNAME!'))\n        -\u003esetTo('username@example.com', 'USERNAME!')\n        -\u003esend();\n```\n## Profits\n- if in twig template block `{% block body_text %}...{% endblock %}` is missing and option `generate_text_version` is `true` then text version will be generated by [html2text](https://github.com/mtibben/html2text)\n- html version is processed by [CssToInlineStyles](https://github.com/tijsverkoyen/CssToInlineStyles)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullpipe%2Femail-template-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffullpipe%2Femail-template-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullpipe%2Femail-template-bundle/lists"}