Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
coronabytes authored Jan 18, 2024
1 parent 5ab705d commit d9ca603
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,47 @@ dotnet add package Core.Email.Provider.SES
- aws ses
- mailjet
- sendgrid
- postmark
- postmark

# Usage
appsettings.json
```json
{
"Email": {
"Default": "Postmark",
"SMTP": {
"Host": "smtp.***.com",
"Port": 587,
"Username": "***",
"Password": "***",
"Tls": true
},
"Postmark": {
"ServerToken": "***",
"MessageStream": "outbound"
},
"Mailjet": {
"ApiKey": "***"
}
}
}
```

```csharp
serviceCollection.AddCoreEmail();
serviceCollection.AddSmtpProvider("SMTP");
serviceCollection.AddPostmarkProvider("Postmark");
serviceCollection.AddSendGridProvider("SendGrid");
serviceCollection.AddMailjetProvider("MailJet");
serviceCollection.AddSimpleEmailServiceProvider("SES");

var email = serviceProvider.GetRequiredService<ICoreEmail>();

await email.SendAsync(new CoreEmailMessage
{
To = ["test@example.com"],
From = "test@example.com",
Subject = "Transactional Mail Subject",
TextBody = "Transactional Mail Body"
});
```

0 comments on commit d9ca603

Please sign in to comment.