{"id":21535386,"url":"https://github.com/rocketbase-io/email-template-builder","last_synced_at":"2025-09-13T14:29:55.932Z","repository":{"id":57736140,"uuid":"138306834","full_name":"rocketbase-io/email-template-builder","owner":"rocketbase-io","description":"let this service generate your custom html/text emails","archived":false,"fork":false,"pushed_at":"2024-06-26T15:50:00.000Z","size":645,"stargazers_count":67,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T21:49:21.002Z","etag":null,"topics":["builder","email-template","generator"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/rocketbase-io.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-22T13:36:41.000Z","updated_at":"2025-03-25T13:13:14.000Z","dependencies_parsed_at":"2024-05-23T08:44:02.292Z","dependency_job_id":"f90aa130-0c21-4880-ad72-b8955809274b","html_url":"https://github.com/rocketbase-io/email-template-builder","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Femail-template-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Femail-template-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Femail-template-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Femail-template-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocketbase-io","download_url":"https://codeload.github.com/rocketbase-io/email-template-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["builder","email-template","generator"],"created_at":"2024-11-24T03:15:02.228Z","updated_at":"2025-04-15T23:50:08.829Z","avatar_url":"https://github.com/rocketbase-io.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# email-template-builder\n\n![logo](assets/logo.svg)\n\n![build](https://github.com/rocketbase-io/email-template-builder/actions/workflows/ci.yml/badge.svg)\n[![Maven Central](https://badgen.net/maven/v/maven-central/io.rocketbase.mail/email-template-builder)](https://mvnrepository.com/artifact/io.rocketbase.mail/email-template-builder)\n\n\n\nLet this service build your html/text emails in a fluent manner. It doesn't try to reinvent the wheel - it simply extends the given [email-template](https://postmarkapp.com/mailmason) of postmark and backed it for java to use it for many purposes.\n\nYou can write your email content fluently and the template builder cares for the correct instyling, conversation to txt version etc...\n\nFor sending the email I can recommend the spring-boot-starter-mail, simplejavamail or my [postmark-spring](https://github.com/rocketbase-io/postmark-spring)...\n\n### release notes\n- 1.x bases mailgun templates\n  - extra dependency on jsoup for auto inlining/transpiling to text\n  - doc for old api could be found in wiki\n\n- 2.x bases on new postmark templates\n  - pom artifact group changed to **io.rocketbase.mail**\n  - removed jsoup from dependency and changed api in many cases\n  - cleaned up a lot of code\n  - separated module in two pices\n    - common builder\n    - markdown (with markdown support)\n\n## features\n\n- generate html and text mail via one fluent build\n- just pebble-template engine as dependency\n- support for the following content-types\n  - Logo in the header\n  - Text also with HTML support and Alignment configuration\n  - Image with Alignment configuration and Link options\n  - Button with custom Styling\n  - Footer with HTML support and Alignment configuration\n  - Copyright with dynamic Year and Link options\n  - table with header, item/price, total\n  - key value pairs\n  - interface for tables to provide custom layouts\n  - extra module to transpile markdown\n\n## usage\n\n## sample html/text\n```java\n// generate html/text content\nHtmlTextEmail htmlTextEmail = builder\n        .header()\n        .logo(\"https://www.rocketbase.io/img/logo-dark.png\").logoHeight(41)\n        .and()\n        .text(\"Welcome, {{name}}!\").h1().center().and()\n        .text(\"Thanks for trying [Product Name]. We’re thrilled to have you on board. To get the most out of [Product Name], do this primary next step:\").and()\n        .button(\"Do this Next\", \"http://localhost\").blue().and()\n        .text(\"For reference, here's your login information:\").and()\n        .attribute()\n        .keyValue(\"Login Page\", \"{{login_url}}\")\n        .keyValue(\"Username\", \"{{username}}\")\n        .and()\n        .html(\"If you have any questions, feel free to \u003ca href=\\\"mailto:{{support_email}}\\\"\u003eemail our customer success team\u003c/a\u003e. (We're lightning quick at replying.) We also offer \u003ca href=\\\"{{live_chat_url}}\\\"\u003elive chat\u003c/a\u003e during business hours.\",\n                \"If you have any questions, feel free to email our customer success team\\n\" +\n                        \"(We're lightning quick at replying.) We also offer live chat during business hours.\").and()\n        .text(\"Cheers,\\n\" +\n                \"The [Product Name] Team\").and()\n        .copyright(\"rocketbase\").url(\"https://www.rocketbase.io\").suffix(\". All rights reserved.\").and()\n        .footerText(\"[Company Name, LLC]\\n\" +\n                \"1234 Street Rd.\\n\" +\n                \"Suite 1234\").and()\n        .footerImage(\"https://cdn.rocketbase.io/assets/loading/no-image.jpg\").width(100).linkUrl(\"https://www.rocketbase.io\").and()\n        .build();\n\n// sent email\nMimeMessage message = emailSender.createMimeMessage();\nMimeMessageHelper helper = new MimeMessageHelper(message,\n        MimeMessageHelper.MULTIPART_MODE_MIXED_RELATED,\n        StandardCharsets.UTF_8.name());\nhelper.setTo(to);\nhelper.setSubject(subject);\nhelper.setText(htmlTextEmail.getText(), htmlTextEmail.getHtml());\nhelper.setFrom(from);\nemailSender.send(message);\n\n```\n\n### preview HTML-Version\n\n![sample](assets/v2-mail-sample.png)\n\n### preview Text-Version\n\n```\nWelcome, {{name}}!\n\nThanks for trying [Product Name]. We=E2=80=99re thrilled to have you on boa=\nrd. To get the most out of [Product Name], do this primary next step:\n\nDo this Next -\u003e http://localhost\n\nFor reference, here's your login information:\n\nLogin Page: {{login_url}}\nUsername: {{username}}\n\n\nIf you have any questions, feel free to email our customer success team\n(We're lightning quick at replying.) We also offer live chat during business hours.\n\nCheers,\nThe [Product Name] Team\n```\n\n\n### sample table\n```java\nTbConfiguration config = TbConfiguration.newInstance();\nconfig.getContent().setFull(true);\n\nHtmlTextEmail htmlTextEmail = builder\n        .configuration(config)\n        .header().text(header).and()\n        .text(\"Hi {{name}},\").and()\n        .text(\"Thanks for using [Product Name]. This is an invoice for your recent purchase\").and()\n        .tableSimple(\"#.## '€'\")\n        .headerRow(\"Description\", \"Amount\")\n        .itemRow(\"Special Product\\n\" +\n                \"Some extra explanations in separate line\", BigDecimal.valueOf(1333, 2))\n        .itemRow(\"Short service\", BigDecimal.valueOf(103, 1))\n        .footerRow(\"Total\", BigDecimal.valueOf(2363, 2))\n        .and()\n        .button(\"Download PDF\", \"http://localhost\").gray().right().and()\n        .text(\"If you have any questions about this receipt, simply reply to this email or reach out to our support team for help.\").and()\n        .copyright(\"rocketbase\").url(\"https://www.rocketbase.io\").suffix(\". All rights reserved.\").and()\n        .footerText(\"[Company Name, LLC]\\n\" +\n                \"1234 Street Rd.\\n\" +\n                \"Suite 1234\").and()\n        .build();\n```\n\n### preview HTML-Version\n\n![sample-table](assets/v2-mail-sample-table.png)\n\n### sample table with image\n\n```java\nTbConfiguration config = TbConfiguration.newInstance();\nconfig.getContent().setWidth(800);\n\nHtmlTextEmail htmlTextEmail = builder\n        .configuration(config)\n        .header().text(header).and()\n        .text(\"Hi {{name}},\").and()\n        .text(\"Thanks for using [Product Name]. This is an invoice for your recent purchase\").and()\n        .tableSimpleWithImage(\"#.## '€'\")\n        .headerRow(\"Preview\", \"Description\", \"Amount\")\n        .itemRow(\"https://cdn.shopify.com/s/files/1/0255/1211/6260/products/TCW1142-07052_small.jpg?v=1589200198\", \"Damen Harbour Tanktop × 1\\n\" +\n                \"QUARTZ PINK / S\", BigDecimal.valueOf(4995, 2))\n        .itemRow(\"https://cdn.shopify.com/s/files/1/0255/1211/6260/products/TCM1886-0718_201_fdf0be52-639f-4ea8-9143-6bd75e0821b1_small.jpg?v=1583509609\", \"Herren ten Classic T-Shirt\\n\"+\n                \"FOREST GREEN HEATHER / XL\", BigDecimal.valueOf(3995, 2))\n        .itemRow(\"https://cdn.shopify.com/s/files/1/0255/1211/6260/products/TCM1939-0439_1332_da6f3e7c-e18d-4778-be97-c6c0b482b643_small.jpg?v=1583509671\", \"Herren Joshua Hanfshorts\\n\" +\n                \"DARK OCEAN BLUE / XL\", BigDecimal.valueOf(6995, 2))\n        .footerRow(\"Sum\", BigDecimal.valueOf(15985, 2))\n        .footerRow(\"Code - PLANT5\", BigDecimal.valueOf(-799, 2))\n        .footerRow(\"Total incl. Tax\\n\", BigDecimal.valueOf(15186, 2))\n        .and()\n        .button(\"Download PDF\", \"http://localhost\").gray().right().and()\n        .text(\"If you have any questions about this receipt, simply reply to this email or reach out to our support team for help.\").and()\n        .copyright(\"rocketbase\").url(\"https://www.rocketbase.io\").suffix(\". All rights reserved.\").and()\n        .footerText(\"[Company Name, LLC]\\n\" +\n                \"1234 Street Rd.\\n\" +\n                \"Suite 1234\").and()\n        .build();\n```\n\n### preview HTML-Version\n\n![sample-table](assets/v2-mail-sample-table-image.png)\n\nA custom table example could be found in [wiki](https://github.com/rocketbase-io/email-template-builder/wiki/Custom-Table).\n\n## testing\n\n```\ndocker run --rm -it -p 5555:80 -p 2525:25 rnwood/smtp4dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocketbase-io%2Femail-template-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocketbase-io%2Femail-template-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocketbase-io%2Femail-template-builder/lists"}