Skip to main content
All CollectionsTools
What a mailbox is and how to integrate a mailbox in your application
What a mailbox is and how to integrate a mailbox in your application

You can link a Gmail account to a Betty Blocks app. You can use the instructions provided here as a guide when linking other mail clients. 

Betty Blocks avatar
Written by Betty Blocks
Updated over a week ago

Warning!

This is a legacy document. The features described below are only usable within the classic-generation environment.

Currently, Betty Blocks offers faster and more advanced options that are available in next-gen. Before you start working on some new features in your application, consider doing it using the next-gen version. Good luck!

The mailbox in a Betty Blocks application collects incoming mail from one of your mail accounts. You can create actions for processing emails delivered to your mailbox.

The example here is based on setting up a Gmail mail configuration. You can adapt to the configuration required for your organization.

How to integrate a mailbox

Before you set up a mailbox, you need to set up the required configurations.

1. If you are working in, for example, the Pages module, open the Tools menu and select Mailboxes (A). The previous environment is opened in the Mailboxes section.

Note: You may be requested to complete your login details. Once applied, the Mailboxes list is displayed in the previous environment.

2. Open the Tools menu and select Configurations (B) for creating the required configuration for your mailbox.

Setting up a mailbox configuration

1. Select New to open the pane for creating the required configuration details. In the pane that is opened, specify a Name (A) for the configuration file. When you press the Save (B) button, the file name is now displayed.

Open the menu (C) and select Mailbox for the Kind of configuration file. Complete the details requested based on the Gmail settings detailed:

- Address - imap.gmail.com

- Port - set port to 993

- User name - apply your details or the required user name details

- Password - specify the relevant password details.

- Use the checkbox provided to indicate whether or not Secure Sockets Layer (SSL).

Press the Save (E) button to save the details.

An error message is displayed if you try to save the form without completing the above fields. Complete the fields provided and Save again.

If you have completed the fields and an error message (A) is displayed, check the mailbox for the a message as shown below.

If the error message (A) is displayed, you can click on the link shown (B) for allowing access.

Create an Email model

1. Create an email message property and a multifile property for storing the attachments.

2. Setup up properties for capturing the following email details:

- subject

- date

- from

- from_full { email, name}

- to

- to_full {email, name}

- cc, cc_full

- bcc

- bcc_full

- text_part

- html_part

- attachments

- in_reply_to

- message_id

- visible_text, statistics.

3. Create text properties that can save the information that you want to access from the email such as subject, content and from_email.

Create an Action

1. Create a before validation model action.

2. Assign an action that assigns all the values of the email to the right properties.

Create a text variable similar to the following for extracting the data from the mail message property:

var:record.email_message::subject

var:record.email_message_bill::visible_text

Note: Properties - subject, date, from, from_full{ email, name}, to, to_full{email, name}, cc, cc_full, bcc, bcc_full, text_part, html_part, attachments, in_reply_to, message_id, visible_text, statistics)

Create Mailbox and Scenario

Navigate to Mailbox page by:

1. Opening the Tools menu and selecting Mailbox (A).

2. Select New to create a new mailbox. Specify a Description (B) for the Mailbox and use the link (C) button to open the Variable details from the available options.

Press Save to save the details. You can now add a scenario to the mailbox.

3. In edit mode (click on the Edit button), select the Scenarios (A) button.

4. In the Scenarios list panel, select New to create a new scenario.

5. Complete the details in the Scenario form (A) based on your requirements. For example, a scenario to select the created mail message property and the associated Action.

Add a scenario in which you select the created mail message property and the created action.

Once complete, press Save (B) to save the scenario. Press the close button to close the open panels to return to the overall mailbox list

Troubleshooting Mailboxes

The following details common problems that you may run into when integrating Gmail to your mailbox

  • Gmail may identify Betty Blocks as a less-secure app. You need to ensure that a setting is applied that allows information exchange between your application and Betty Blocks and that complies with IT security governance in your organization.

  • Gmail you have to enable IMAP or POP3 access, as Betty Blocks is not otherwise able to access your mail. Open Gmail settings and click on the Forwarding and POP/IMAP tab to update the settings as required.

Did this answer your question?