Sending email from customer website

Hi there ,

Can we use create email API in genesys cloud : POST /api/v2/conversations/emails to send an email from a website .

Exact usecase : A customer logs into a website and there he would have a small form where he can fill subject , body and on click of send email button , an inbound email should arrive to Genesys.

I was trying out above api with body as follows . Will this be a proper approach? If yes , what should come under provider field (any examples? )

{
"queueId": "42a2bd38-5aa7-423e-bafd-86d593d21456",
"flowId": "",
"provider": "",
"skillIds": [],
"languageId": "",
"priority": 0,
"attributes": {},
"toAddress": "Care2@engg.aps1.pure.cloud",
"toName": "",
"fromAddress": "customer@xyz.com",
"fromName": "garima",
"subject": "in real scenario this body will be picked from webpage's subject field",
"direction": "INBOUND",
"htmlBody": "this is a test",
"textBody": "in real scenario this body will be picked from webpage's body field",
"externalContactId": ""
}

Regards
Garima.

Hi Garima,

To use Genesys Cloud API you will need to be authentified as Genesys Cloud user, which look strange in your case.

you should rely on javascript lib or other web lib to send email

Hi Frederic,

How I tried is to initiate an email through API explorer and getting an interaction on Genesys Cloud. But agent doesn't see any email subject/body/option to reply to the email. See screenshot below. I was hoping to see a proper incoming mail going to agent using this API. Can you help me understand , when the create email api is helpful?

API : POST /api/v2/conversations/emails
API body :-
{
"queueId": "42a2bd38-5aa7-423e-bafd-86d593d21456",
"flowId": "",
"provider ": "engg@onlinemicrosoft.com",
"skillIds": [],
"languageId": "",
"priority": 0,
"attributes": {},
"toAddress": "Care2@engg.aps1.pure.cloud",
"toName": "",
"fromAddress": "customer@xyz.com",
"fromName": "garima",
"subject": "in real scenario this body will be picked from webpage's subject field",
"direction": "INBOUND",
"htmlBody": "this is a test",
"textBody": "in real scenario this body will be picked from webpage's body field",
"externalContactId": ""
}

Thanks in Advance ,
Garima.

Note the description for that endpoint, emphasis added:

Create an email conversation. If the direction of the request is INBOUND, this will create an external conversation with a third party provider. If the direction of the the request is OUTBOUND, this will create a conversation to send outbound emails on behalf of a queue.

What you're seeing is correct per the endpoint's documentation. You have created a 3rd party "email" (that distinctly bears no resemblance to an email). You can read more about 3rd party object routing here: https://developer.genesys.cloud/commdigital/third-party-object-routing/. TL;DR it's NOT an email and you have to build out your own solution entirely from scratch (or integrate a 3rd party) to send and receive messages with your customer via the transport of your choice. You must also build and supply a custom UI to the agent to interact with that media. This probably isn't what you want unless you have a plug-n-play ticketing solution already.

If you use outbound as the direction, it will create an outbound email on behalf of a queue that will send an email. However, this isn't what you want either because this endpoint requires a user context, i.e. a Genesys Cloud user must log in to your app to send an outbound email as that user. Your use case is for customers to send emails, and they are not Genesys Cloud users and therefore cannot log in to use this endpoint.

What you're looking for is integrating your website with your email provider. Your own backend services for your web site will collect the user's data from the frontend and integrate with a 3rd party mail provider of your choosing to send the email to an inbox that's monitored by Genesys Cloud. Once the email has been received in the monitored inbox, it will be routed as normal.

TL;DR the integration you're attempting to build does not involve Genesys Cloud in any way until after the email has been sent.

Hi @garimabalodi,

Agents can not see the content of emails generated by the API. This is intentional because the emails generated by the API are not considered Genesys Cloud inbound ACD emails, they are classified as third-party emails.

When configuring the API parameters, you have the option to specify the direction as either inbound or outbound. For inbound use cases, if you attempt to use Purecloud Email as the provider, the API will fail. This is because Purecloud Email is exclusively reserved for native emails within Genesys Cloud. If you choose any other value for the provider, the API will establish an external conversation with a third-party provider.
In such cases, you will receive the third-party email, but you will not be able to view its content or respond to it through Architect or the GUI.

In my opinion, to send emails to Genesys Cloud and treat them as ACD emails, you must establish an integration with a third-party SMTP server. This SMTP server will be responsible for routing the emails to the designated Genesys Cloud email address.

I hope that helps :slight_smile:

Best regards,

Charaf

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.