{"id":26467444,"url":"https://github.com/sevensource/html-email-service","last_synced_at":"2025-03-19T14:41:46.517Z","repository":{"id":5498722,"uuid":"6697653","full_name":"sevensource/html-email-service","owner":"sevensource","description":"Library for creating and sending HTML email with Spring. Contains functionality to transform text to html, as well as html to text.","archived":false,"fork":false,"pushed_at":"2020-10-13T00:21:46.000Z","size":109,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-16T01:16:04.318Z","etag":null,"topics":["email","email-sender","email-template","java","java-mail","spring","thymeleaf"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sevensource.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":"2012-11-15T01:06:41.000Z","updated_at":"2019-07-12T05:50:24.000Z","dependencies_parsed_at":"2022-07-26T01:16:11.876Z","dependency_job_id":null,"html_url":"https://github.com/sevensource/html-email-service","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevensource%2Fhtml-email-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevensource%2Fhtml-email-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevensource%2Fhtml-email-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sevensource%2Fhtml-email-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sevensource","download_url":"https://codeload.github.com/sevensource/html-email-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244448141,"owners_count":20454443,"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":["email","email-sender","email-template","java","java-mail","spring","thymeleaf"],"created_at":"2025-03-19T14:41:45.977Z","updated_at":"2025-03-19T14:41:46.509Z","avatar_url":"https://github.com/sevensource.png","language":"Java","readme":"[![GitHub Tag](https://img.shields.io/github/tag/sevensource/html-email-service.svg?maxAge=3600)](https://github.com/sevensource/html-email-service/tags)\n[![Maven Central](https://img.shields.io/maven-central/v/org.sevensource.mail/html-email-service.svg?maxAge=3600)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.sevensource.mail%22%20AND%20a%3A%22html-email-service%22)\n[![License](https://img.shields.io/github/license/sevensource/html-email-service.svg)](https://github.com/sevensource/html-email-service/blob/master/LICENSE)\n[![Build Status](https://img.shields.io/circleci/project/github/sevensource/html-email-service.svg)](https://circleci.com/gh/sevensource/html-email-service)\n\n\n# html-email-service\n\n## Wrapper library for creating and sending HTML email with Spring.\n\n * uses Thymeleaf for templating\n * transforms text to html\n * transforms html to text\n * attachments (inline and attachment)\n\n## Example\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003eorg.sevensource.mail\u003c/groupId\u003e\n\t\u003cartifactId\u003ehtml-email-service\u003c/artifactId\u003e\n\t\u003cversion\u003e${the.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n```java\n\n@Configuration\npublic class EmailServiceConfiguration {\n\t@Autowired\n\tApplicationContext applicationContext;\n\t\n\t// also see ConfigurableJavaMailSenderConfiguration\n\t@Autowired \n\tJavaMailSender javaMailSender;\n\t\n\t@Bean\n\tpublic EmailTemplateRendererService emailTemplateRenderService() {\n\t\treturn new EmailTemplateRendererService(factory);\n\t}\n\t\n\t@Bean\n\tpublic EmailSenderService emailSenderService() {\n\t\tTemplateEngineFactory factory = new DefaultTemplateEngineFactory(applicationContext);\n\t\treturn new EmailTemplateRendererService(factory);\n\t}\n}\n```\n\n```java\npublic void sendmail() {\n\tDefaultEmailModel model = new DefaultEmailModel();\n\tmodel.setFrom(\"foo@bar.com\", \"Foobar\");\n\tmodel.addTo(\"far@boo.com\", \"Farboo\");\n\tmodel.setSubject(\"Let's get things started\");\n\t\n\t//create a simple HTML representation from plain text\n\tString text = \"Make sure to check out http://www.github.com\"; \n\tString html = emailTemplateRendererService.textToHtml(text);\n\tmodel.setText(text);\n\tmodel.setHtml(html);\n\t\n\temailService.sendMail(model);\n\t\n\t// ...or render a Thymeleaf template into HTML and automatically\n\t// provide a text only fallback version\n\tMap\u003cString, Object\u003e renderModel = new HashMap\u003c\u003e();\n\trenderModel.put(\"message\", \"Check out http://www.github.com\");\n\thtml = emailTemplateRendererService.render(\"someTemplate\", emailModel, renderModel, Locale.ENGLISH);\n\ttext = emailTemplateRendererService.htmlToText(html);\n\tmodel.setText(text);\n\tmodel.setHtml(html);\n\t\n\temailService.sendMail(model);\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevensource%2Fhtml-email-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsevensource%2Fhtml-email-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsevensource%2Fhtml-email-service/lists"}