{"id":25015268,"url":"https://github.com/ditschedev/mailo","last_synced_at":"2025-04-12T23:13:59.501Z","repository":{"id":40748032,"uuid":"317201656","full_name":"ditschedev/mailo","owner":"ditschedev","description":"This is a client for sending emails easily from a Spring Boot REST API. It makes use of Mustache for templating and is adaptable. ","archived":false,"fork":false,"pushed_at":"2025-04-11T15:03:38.000Z","size":93,"stargazers_count":4,"open_issues_count":13,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T23:13:53.548Z","etag":null,"topics":["email","java","mail","mjml","mjml4j","smtp","template","templates"],"latest_commit_sha":null,"homepage":"","language":"Java","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/ditschedev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-30T11:26:39.000Z","updated_at":"2024-09-22T06:11:17.000Z","dependencies_parsed_at":"2024-01-10T17:01:07.689Z","dependency_job_id":"6f10b67d-7092-4e46-a55c-709b488465e0","html_url":"https://github.com/ditschedev/mailo","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ditschedev%2Fmailo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ditschedev%2Fmailo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ditschedev%2Fmailo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ditschedev%2Fmailo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ditschedev","download_url":"https://codeload.github.com/ditschedev/mailo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643006,"owners_count":21138355,"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","java","mail","mjml","mjml4j","smtp","template","templates"],"created_at":"2025-02-05T08:18:35.991Z","updated_at":"2025-04-12T23:13:59.476Z","avatar_url":"https://github.com/ditschedev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mailo - Java Mail Library\n\nThis is a client for sending emails easily from java applications :heart:.\n\nIt is extendable, as you can add custom mail providers and comes with a SMTP and some mail service providers out of the box.\n\n## Installation\nAdd the dependency to your maven dependencies:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.ditsche\u003c/groupId\u003e\n    \u003cartifactId\u003emailo\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Configuration\n\n### Environment Variables\nConfiguration is easy using the predefined environment variables. See below for more details:\n\n##### `MAILO_APP_ID`\nSets the MJML application id obtained by requesting api keys from [mjml.io](mjml.io).\n\n##### `MAILO_APP_SECRET`\nSets the MJML application secret obtained by requesting api keys from [mjml.io](mjml.io).\n\n##### `MAILO_TEMPLATE_DIR`\nSets the root template directory in the classpath where all mail templates are located. \nDefaults to `./templates/`.\n\n### Config Object\nThe libary is designed to be configured through environment variables, but you can use the config object too. Before sending or\nbuilding mails, get the current config by using:\n\n```java\nMailoConfig config = MailoConfig.get();\n```\n\nNow you can set the values as you need them to be programmatically.\n\n\n## Usage\n\n### Creating templates\nWrite your template with mjml and place them in your template directory inside of your Java Application. By default the library\nsearches `/templates/**` in your classpath resources.\n\n### Sending mails\nTo send a mail using smtp, adapt the following code snippet.\n\n```java\n// Create a smtp config for our mail provider\nSmtpConfig config = new SmtpConfig();\nconfig.setHost(\"smtp.example.com\");\nconfig.setPort(465);\nconfig.setUsername(\"test@example.com\");\nconfig.setPassword(\"test123!\");\n\n// Create a mail provider\nMailProvider mailProvider = new SmtpMailProvider(config);\n\n// Build a mail\nMail mail = MailBuilder.mjml()\n    .subject(\"Email Subject\")\n    .from(new MailAddress(\"sender@test.com\", \"Sender name\"))\n    .to(new MailAddress(\"test@test.com\", \"Test Name\"))\n    .params(\"url\", \"http://example.com\")\n    .params(\"name\", \"John Doe\")\n    .template(\"path/to/template.mjml\") // .mjml extension is optional\n    .build();\n\n// Send the mail\nmailProvider.send(mail);\n```\n\nYou can send mails using some big mail providers as well, if you don't like to use smtp directly. For example Postmark:\n```java\n// Create a mail provider\nMailProvider mailProvider = new PostmarkMailProvider(\"YOUR_POSTMARK_SERVER_TOKEN\");\n\n// Build a mail\nMail mail = MailBuilder.create()\n    .subject(\"Email Subject\")\n    .from(new MailAddress(\"sender@test.com\", \"Sender name\"))\n    .to(new MailAddress(\"test@test.com\", \"Test Name\"))\n    .params(\"url\", \"http://example.com\")\n    .params(\"name\", \"John Doe\")\n    .template(\"path/to/template.mjml\")\n    .build();\n\n// Send the mail\nmailProvider.send(mail);\n```\n\nCurrently available are:\n* Postmark\n* SendGrid\n* Sendinblue\n* ~~Mailgun~~ (coming soon)\n* ~~Mailjet~~ (coming soon)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fditschedev%2Fmailo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fditschedev%2Fmailo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fditschedev%2Fmailo/lists"}