From 0226b82ddd438ed9df873b2ffff7c4840dfb43cf Mon Sep 17 00:00:00 2001 From: Lakshya Agarwal <111621448+lakshya6378@users.noreply.github.com> Date: Wed, 13 May 2026 12:09:03 +0530 Subject: [PATCH 1/2] Docs: Modify email poller check for version 3.1.0 Updated the poller state check for email sending to reflect changes in @azure/communication-email version 3.1.0. --- .../email/includes/send-email-js.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/articles/communication-services/quickstarts/email/includes/send-email-js.md b/articles/communication-services/quickstarts/email/includes/send-email-js.md index ab232c87e3481..9cfec7e7e0b6e 100644 --- a/articles/communication-services/quickstarts/email/includes/send-email-js.md +++ b/articles/communication-services/quickstarts/email/includes/send-email-js.md @@ -187,9 +187,22 @@ async function main() { const poller = await emailClient.beginSend(message); - if (!poller.getOperationState().isStarted) { - throw "Poller was not started." - } +// NOTE: +// In @azure/communication-email version 3.1.0, +// the `isStarted` flag was removed from `poller.getOperationState()`. +// Instead, the poller state now exposes a `status` field with values +// such as "running", "succeeded", etc. +// +// Previous check: version 3.0.0, +// if (!poller.getOperationState().isStarted) { +// throw "Poller was not started." +// } + +// Updated check for v3.1.0+: +if (poller.getOperationState().status !== "running") { + throw "Poller failed to start."; +} + let timeElapsed = 0; while(!poller.isDone()) { From 8cb6f406a35187b84a90ba9871fbbc9b027cf689 Mon Sep 17 00:00:00 2001 From: Lakshya Agarwal <111621448+lakshya6378@users.noreply.github.com> Date: Wed, 13 May 2026 22:25:21 +0530 Subject: [PATCH 2/2] Revise email sending logic for v3.1.0 changes Updated email sending example to reflect changes in @azure/communication-email v3.1.0. --- .../email/includes/send-email-js.md | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/articles/communication-services/quickstarts/email/includes/send-email-js.md b/articles/communication-services/quickstarts/email/includes/send-email-js.md index 9cfec7e7e0b6e..b2159206148bd 100644 --- a/articles/communication-services/quickstarts/email/includes/send-email-js.md +++ b/articles/communication-services/quickstarts/email/includes/send-email-js.md @@ -163,6 +163,9 @@ For simplicity, this article uses connection strings, but in production environm ### Send an email message To send an email message, call the `beginSend` function from the `EmailClient`. This method returns a poller that checks on the status of the operation and retrieves the result once finished. +> Note: +> In `@azure/communication-email` v3.1.0 and later, the `isStarted` property was removed from `poller.getOperationState()`. The sample below uses the `status` field instead to validate that the poller has started successfully. + ```javascript @@ -187,22 +190,9 @@ async function main() { const poller = await emailClient.beginSend(message); -// NOTE: -// In @azure/communication-email version 3.1.0, -// the `isStarted` flag was removed from `poller.getOperationState()`. -// Instead, the poller state now exposes a `status` field with values -// such as "running", "succeeded", etc. -// -// Previous check: version 3.0.0, -// if (!poller.getOperationState().isStarted) { -// throw "Poller was not started." -// } - -// Updated check for v3.1.0+: -if (poller.getOperationState().status !== "running") { - throw "Poller failed to start."; -} - + if (poller.getOperationState().status !== "running") { + throw "Poller failed to start."; + } let timeElapsed = 0; while(!poller.isDone()) {