You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--data '{"email":"example@mail.ru","subject":"Confirm your email", "body":"Please visit this <a>link</a> to confirm your email."}' \
54
54
http://localhost:5000/api/email/send
55
+
```
56
+
57
+
## How to use RTUITLab.EmailService.Client package
58
+
59
+
1. Install [RTUITLab.EmailService.Client package](https://dev.azure.com/rtuitlab/RTU%20IT%20Lab/_packaging?_a=package&feed=ITLab&package=RTUITLab.EmailService.Client&protocolType=NuGet) to your ASP.Net Core project
60
+
2. Extend your appsettings.json file with following code:
61
+
```js
62
+
{
63
+
// configuration omitted
64
+
"EmailSenderOptions": {
65
+
"BaseAddress":"url to your email service that you've created upper. http://localhost:5000",
66
+
"Key":"some random key for Header Authoriztion. Check instructions above"
67
+
}
68
+
// configuration omitted
69
+
}
70
+
```
71
+
3. Edit Startup.cs file:
72
+
```c#
73
+
// Add email service
74
+
services.AddEmailSender(Configuration
75
+
.GetSection(nameof(EmailSenderOptions))
76
+
.Get<EmailSenderOptions>());
77
+
```
78
+
4. By following code you'll send request to your email service. Email service will deliver emails:
79
+
```c#
80
+
RTUITLab.EmailService.Client.IEmailSendersender;
81
+
awaitsender.SendEmailAsync("test@test.com", "Email letter subject", "<h1>Html body</h1>")
0 commit comments