Azure Communication Services : unable to send an email using JS SDK

Etienne HOVAERE 41 Reputation points
2022-11-10T17:03:36.827+00:00

Hi,

as I'm using ACS for call features, I decided to know use it to send emails.

I thus installed @azure/communication-email": "^1.0.0-beta.1"
(are some feature of ACS not in preview??!!)

anyway, following the tutorial, I'm doing that:

const client = new EmailClient("endpoint=https://mysuperdomain.communication.azure.com/;accesskey=hypersecret");  
const emailMessage: EmailMessage = {  
  sender: "noreply@mydomain.com",  
  content: {  
 subject: "test",  
 plainText: 'test',  
  },  
  recipients: {  
 to: [  
   {  
 email: "myemail@mydomain.com",  
 displayName: "Customer Name"  
   },  
 ],  
  },  
};  
  
const response = await client.send(emailMessage);  

and it takes a few minutes to finally return the following HTML

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body {font-family:Arial; margin-left:40px; }img  { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p  { font-size: 13px; color: #000000; margin: 7px 0px 0px0px}#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Service unavailable</title></head><body><div id='content'><div id='message'><h2>Our services aren't available right now</h2><p>We're working to restore all services as soon as possible. Please check back soon.</p></div><div id='errorref'><span>04SxtYwAAAADXcapFF0D+SJq+iV9LXU6XUEFSMDJFREdFMDYyMAA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=</span></div></div></body></html>  

Could you please help me to use the API ?

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
808 questions
{count} votes