Skip to content

Commit ce624c8

Browse files
Merge pull request #276214 from yogeshmo/email/update-java-sdk-qs-wording
Updating Email Java SDK docs
2 parents 54549b3 + f7bebba commit ce624c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

articles/communication-services/quickstarts/email/includes/send-email-java.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ To send the email message, call the `beginSend` function from the `EmailClient`.
213213

214214
## [Sync Client](#tab/sync-client)
215215

216-
Calling `beginSend` on the sync client returns a `SyncPoller` object, which can be used to check on the status of the operation and retrieve the result once it's finished. Note that the initial request to send an email will be sent as soon as the `beginSend` method is called. Sending an email is a long running operation, so calling `getFinalResult` on the poller returned by `beginSend` could potentially block the application for a long time. The recommended method is to do manual polling at an interval that's appropriate for your application needs as demonstrated in the sample below.
216+
Calling `beginSend` on the sync client returns a `SyncPoller` object, which can be used to check on the status of the operation and retrieve the result once it's finished. Note that the initial request to send an email will be sent as soon as the `beginSend` method is called. **Sending an email is a long running operation. Its important to note that the `getFinalResult()` method on the poller is a blocking operation until a terminal state (`SUCCESSFULLY_COMPLETED` or `FAILED`) is reached.** The recommended method is to do manual polling at an interval that's appropriate for your application needs as demonstrated in the sample below.
217217

218218
```java
219219
try
@@ -259,11 +259,12 @@ catch (Exception exception)
259259

260260
## [Async Client](#tab/async-client)
261261

262-
Calling `beginSend` on the async client returns a `PollerFlux` object to which you can subscribe. You will want to set up the subscriber in a seperate process to take advantage of the asynchronous functionality. Note that the initial request to send an email will not be sent until a subscriber is set up.
262+
Calling `beginSend` on the async client returns a `PollerFlux` object to which you can subscribe. The callbacks defined in the subscribe method will be triggered once the email sending opertion is complete. **Note that the initial request to send an email will not be sent until a subscriber is set up.**
263263

264264
```java
265+
PollerFlux<EmailSendResult, EmailSendResult> poller = emailAsyncClient.beginSend(emailMessage);
265266
// The initial request is sent out as soon as we subscribe the to PollerFlux object
266-
emailClient.beginSend(emailMessage).subscribe(
267+
poller.subscribe(
267268
response -> {
268269
if (response.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
269270
System.out.printf("Successfully sent the email (operation id: %s)", response.getValue().getId());

0 commit comments

Comments
 (0)