Update OnReconnect docs and README examples
Updated XML documentation in `OnReconnect.cs` to reference the updated `EmailSender.ConnectRabbitMq` method signature, clarifying its behavior when a connection is already established. Revised `README.md` examples to replace `OutgoingEmailEvent` with `Email` and removed `Id` and `QueuedAt` properties, as they are now set internally. Added a note to clarify required fields for the `Email` object. Added a new section to the `README.md` demonstrating how to check the connection status using `EmailSender.IsConnected`.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
namespace DigitalData.MessagingService.Client;
|
namespace DigitalData.MessagingService.Client;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines the behavior when <see cref="EmailSender.ConnectRabbitMq"/> is called
|
/// Defines the behavior when <see cref="EmailSender.ConnectRabbitMq(Action{RabbitMQ.RabbitMqConfiguration}, OnReconnect)"/> is called
|
||||||
/// while a connection has already been established.
|
/// while a connection has already been established.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum OnReconnect
|
public enum OnReconnect
|
||||||
|
|||||||
@@ -63,30 +63,28 @@ EmailSender.ConnectRabbitMq(
|
|||||||
### 2. E-Mail versenden
|
### 2. E-Mail versenden
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
EmailSender.Send(new OutgoingEmailEvent
|
EmailSender.Send(new Email
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
|
||||||
Recipient = "empfaenger@beispiel.de",
|
Recipient = "empfaenger@beispiel.de",
|
||||||
Subject = "Willkommen",
|
Subject = "Willkommen",
|
||||||
Body = "<p>Hallo Welt!</p>",
|
Body = "<p>Hallo Welt!</p>",
|
||||||
IsHtml = true,
|
IsHtml = true
|
||||||
QueuedAt = DateTime.Now
|
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
```vb
|
```vb
|
||||||
EmailSender.Send(New OutgoingEmailEvent With {
|
EmailSender.Send(New Email With {
|
||||||
.Id = Guid.NewGuid(),
|
|
||||||
.Recipient = "empfaenger@beispiel.de",
|
.Recipient = "empfaenger@beispiel.de",
|
||||||
.Subject = "Willkommen",
|
.Subject = "Willkommen",
|
||||||
.Body = "<p>Hallo Welt!</p>",
|
.Body = "<p>Hallo Welt!</p>",
|
||||||
.IsHtml = True,
|
.IsHtml = True
|
||||||
.QueuedAt = DateTime.Now
|
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
`Send` ist eine **Fire-and-Forget**-Methode: die Nachricht wird in die RabbitMQ-Queue eingereiht und der aufrufende Code wartet nicht auf die eigentliche Zustellung.
|
`Send` ist eine **Fire-and-Forget**-Methode: die Nachricht wird in die RabbitMQ-Queue eingereiht und der aufrufende Code wartet nicht auf die eigentliche Zustellung.
|
||||||
|
|
||||||
|
> **Hinweis:** `Id` und `QueuedAt` werden intern automatisch gesetzt. Im `Email`-Objekt müssen nur `Recipient`, `Subject`, `Body` und `IsHtml` angegeben werden.
|
||||||
|
|
||||||
### 3. Verbindungsstatus prüfen
|
### 3. Verbindungsstatus prüfen
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
|
|||||||
Reference in New Issue
Block a user