{"id":22530139,"url":"https://github.com/ultimaweapon/composer","last_synced_at":"2026-04-27T21:31:56.417Z","repository":{"id":91005080,"uuid":"359769499","full_name":"ultimaweapon/composer","owner":"ultimaweapon","description":"Send the emails from dynamic templates without re-deploying your .NET app","archived":false,"fork":false,"pushed_at":"2022-03-05T15:14:52.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-27T06:20:36.624Z","etag":null,"topics":["csharp","dotnet","email"],"latest_commit_sha":null,"homepage":"","language":"C#","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/ultimaweapon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2021-04-20T10:09:24.000Z","updated_at":"2024-08-06T16:43:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a1a2e12-26c2-4db9-b0b2-5c813e5c899a","html_url":"https://github.com/ultimaweapon/composer","commit_stats":null,"previous_names":["ultimicro/composer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ultimaweapon/composer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultimaweapon%2Fcomposer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultimaweapon%2Fcomposer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultimaweapon%2Fcomposer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultimaweapon%2Fcomposer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ultimaweapon","download_url":"https://codeload.github.com/ultimaweapon/composer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultimaweapon%2Fcomposer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"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":["csharp","dotnet","email"],"created_at":"2024-12-07T07:18:27.751Z","updated_at":"2026-04-27T21:31:56.394Z","avatar_url":"https://github.com/ultimaweapon.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Composer\n[![Nuget](https://img.shields.io/nuget/v/Composer)](https://www.nuget.org/packages/Composer)\n\nThis is a framework for .NET to compose an email from a configured template so the email format can be update on the fly without updating the application code.\n\n## Usage\n\nFirst add essential services to `IServiceCollection` by invoke `AddComposer` extension method:\n\n```csharp\nservices.AddComposer();\n```\n\n`AddComposer` return an object for configure Composer. The application required to provider `IEmailSender` and `ITemplateProvider` by invoke `AddSender`\nand `AddTemplateProvider`:\n\n```csharp\nservices\n    .AddComposer()\n    .AddSender\u003cSenderImplementation\u003e()\n    .AddTemplateProvider\u003cTemplateProviderImplementation\u003e();\n```\n\n### SMTP sender\n\nSMTP sender is shipped with Composer so you don't need to install additional package to use it. To use SMTP sender invoke `AddSmtpSender`:\n\n```csharp\nservices\n    .AddComposer()\n    .AddSmtpSender(options =\u003e\n    {\n        options.SmtpServer = \"host\";\n        options.SmtpPort = 25;\n    })\n    .AddTemplateProvider\u003cTemplateProviderImplementation\u003e();\n```\n\n### Available sender\n\n- [Amazone SES](https://github.com/ultimicro/composer-aws)\n\n### Available template provider\n\n- [StringTemplate 4](https://github.com/ultimicro/composer-stringtemplate)\n\n### Define an email\n\nYou need to create a new class that derived from `Email` class. Each class represents one type of email you want to send (e.g. an email to send when user has\nsigned up).\n\n```csharp\nnamespace SampleApp;\n\nusing System;\nusing Composer;\n\ninternal sealed class RegistrationCompletedEmail : Email\n{\n    public static readonly Guid Id = new Guid(\"e8c01835-bc01-4f03-b4f7-197d0d0a3b4a\");\n\n    public RegistrationCompletedEmail(string username)\n    {\n        this.Username = username;\n    }\n\n    public string Username { get; }\n\n    protected override object TemplateId =\u003e Id;\n\n    protected override object? BuildTemplateData() =\u003e new { this.Username };\n}\n```\n\n### Send an email\n\nInject `IEmailComposer` to the class you want to send email. Then invoke `ComposeAsync`:\n\n```csharp\nvar email = new RegistrationCompletedEmail(\"john\");\n\nawait composer.ComposeAsync(\"john@example.com\", email, cancellationToken);\n```\n\n### Add attachments\n\nOverride `Email.BuildAttachments` or `Email.BuildAttachmentsAsync` to provide attachments for the email.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fultimaweapon%2Fcomposer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fultimaweapon%2Fcomposer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fultimaweapon%2Fcomposer/lists"}