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;
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
public enum OnReconnect
|
||||
|
||||
@@ -63,30 +63,28 @@ EmailSender.ConnectRabbitMq(
|
||||
### 2. E-Mail versenden
|
||||
|
||||
```csharp
|
||||
EmailSender.Send(new OutgoingEmailEvent
|
||||
EmailSender.Send(new Email
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Recipient = "empfaenger@beispiel.de",
|
||||
Subject = "Willkommen",
|
||||
Body = "<p>Hallo Welt!</p>",
|
||||
IsHtml = true,
|
||||
QueuedAt = DateTime.Now
|
||||
IsHtml = true
|
||||
});
|
||||
```
|
||||
|
||||
```vb
|
||||
EmailSender.Send(New OutgoingEmailEvent With {
|
||||
.Id = Guid.NewGuid(),
|
||||
EmailSender.Send(New Email With {
|
||||
.Recipient = "empfaenger@beispiel.de",
|
||||
.Subject = "Willkommen",
|
||||
.Body = "<p>Hallo Welt!</p>",
|
||||
.IsHtml = True,
|
||||
.QueuedAt = DateTime.Now
|
||||
.IsHtml = True
|
||||
})
|
||||
```
|
||||
|
||||
`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
|
||||
|
||||
```csharp
|
||||
|
||||
Reference in New Issue
Block a user