Email configuration

In this article, we explain everything regarding the email action in Spotler AIgent. For example, you can find explanations on how to configure an email account, how to ask a chatbot user for an email address, and how to add an email address to your chatbot.

Configuring an email account

With the email action, you can let your chatbot send emails in certain points in your conversation. To make this work, you'll need an email account and the details of your mail provider's SMTP server.

You can use any mail account, as long as the provider has enabled the SMTP-server for outgoing email.

Configuring your email in Spotler AIgent

Step 1: Go to Build > Actions > E-mail configuration.


Step 2: Enter your host's SMTP server name, the mail address from which emails are sent and the SMTP port number through which the mail should be sent (standard ports are 25, 465 or 587, check your provider for the exact host name and port number).

Step 3: Enter user name and password for the mail account that you specified in the Sender field.

Step 4: Select which safety protocol Spotler AIgent should use for sending your mail (check your provider on whether this should be TLS or SSL).

Step 5: Save your email configuration.

Common SMTP setttings

Field Gmail Office365
Host smtp.gmail.com smtp.office365.com
Sender This is your Gmail or Gsuite email address. This is your Office365 email address.
Port 587 587
User This is your Gmail or Gsuite email address. This is your Office365 email address.
Password The password of your Gmail or Gsuite email. The password of your Office365 email.
UseTls On On
UseSsl Off Off

 

Google by default disables the use of smtp. If you want to use that, go to this Google page and allow less secure apps: https://myaccount.google.com/lesssecureapps

Asking your user for their email

Before you can send an email to your user, you'll first need to capture their email address. Let's use an example 'order status' to have your bot ask for the user's email, so that they can send a mail message with the order information.

First, make sure that there's an entity for email, like mail.address. If you don't have one yet, create one first.

Step 1: Create a user intent 'system.status' so that your user can ask for the order status.

Step 2: Create a bot question: 'Great, what's your mail address?' to capture your user's email. To do so, we need an entity for email, like system.email. If you don't have an entity for this yet, you can create one by simply typing an entity name in the 'Entity' field.

Step 3: Create a user turn where the user can enter their email. Select the email entity, and select the option 'Save user message'.

Step 4: Create a bot reply to confirm the user's email. Use the variable {{system.email}} (or the name of your own entity for email) to show the mail address that your user entered.

Adding email to your chatbot

Once you have asked for the email address of the chatbot user, the next step is to add an email action in the dialog.

In your conversation, select the point where you want your bot to send an email to your user. Add an Action turn and select action type 'Send Email'.

In the email recipient, you can either enter:

  • Your own email address, if you are the recipient of the mail. This can be a constant value, in this case just complete email@address.com. This will be used if you want to receive a reminder of the conversation for your own administration or ticketing service.
  • The email address of the user, which would have been collected prior in the conversation. If you used the default entities in the platform, you most likely would have used the following entity: {{system.mail}}. This will be used if you want to send some additional information to the user by email, like a confirmation.


When setting up the email action turn, enter the following information:

  • Email Recipient: The email address to which the mail will be sent
  • Subject: the subject line of your email
  • Email body: the message text. Here too, you can use information that you retrieved earlier in your conversation. Simply insert the entities between curly brackets, and the retrieved values will automatically be inserted.

The slots in your mail message will only be filled when your chatbot has actually recognized and stored values for these slots. If no values can be found, your user will see the empty slots with curly brackets instead.

Example: Google

Google by default disables the use of smtp. If you want to use that, go to this Google page and allow less secure apps: https://myaccount.google.com/lesssecureapps

  • In Host, type 'smtp.gmail.com '
  • In Sender, type the email
  • In Port, type '587'
  • In User, type the same mail address as in the 'Sender' field

Example: Google with 2FA

If you don't turn off 2-factor authentication and don't allow less secure apps then check the settings in your Gmail account:

  • Settings >
  • Advanced settings >
  • Forwarding and POP/IMAP >
  • Select Enable IMAP >
  • Save

  • Open your google account
  • Select 'Security'
  • Click on the '2-Step Verification' (confirm password)

Select 'App-password'

 

  • Type the name in the field and click on the 'Create' button

Zrzut ekranu 2023-11-28 130025.png

  • Copy the password

  • Paste the password in Spotler AIgent, on the email configuration page.
  • Click on the 'SAVE' button -> Success message is visible!