# Send an Email via Mailjet Plugin

You can send emails to your users from Acho apps via [Mailjet](https://www.mailjet.com/) Plugin. You'll need a free Mailjet account to use Mailjet send API service.&#x20;

### 1. Find your Mailjet API Key and Secret Key

Go to account setting -> Rest API -> [API Key Management (Primary and Sub-account)](https://app.mailjet.com/account/apikeys) to acquire your api key and secret key.

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FOPasYPfdslQ0pFe4aYx5%2Fimage.png?alt=media&#x26;token=0f39856f-40dc-44b7-a490-12f7b0580e4e" alt=""><figcaption></figcaption></figure>

### 2. Create or enter an app[​](https://docs.retool.com/queries/guides/emails#1-create-an-app) <a href="#id-1-create-an-app" id="id-1-create-an-app"></a>

If you haven't created an app yet, [log in Acho](https://app.acho.io/main/apps) and click **Create new Data App**. Create a blank app or start from a template.&#x20;

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FOtMfhUOHWe9uTSvzCM71%2Fimage.png?alt=media&#x26;token=ae87c21c-7e61-4014-be7f-baa013e7e005" alt=""><figcaption></figcaption></figure>

### 3.  Install Mailjet service

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FdZM509e1WnzHCclhGZ87%2Fplugin_mailjet.jpg?alt=media&#x26;token=e3d0356a-3f86-4994-9571-47ace9556413" alt=""><figcaption></figcaption></figure>

Find [plugin store](https://docs.acho.io/app-builder/app-construction/plugin-store) on the side bar, click on Mailjet API, install the API and add to API services. Once it is installed and added to API services, you can find it as an [action](https://docs.acho.io/app-construction/interactions/add-an-interaction#actions) in API services category.

### 4.  Add an input element and add [action flow](https://docs.acho.io/app-construction/interactions#action-flow)

Drag an [input](https://docs.acho.io/app-builder/app-construction/elements/form-elements/input) element from elements list, and add **event** -> **action** to trigger the Send Email Service.  In this example, I use Press Enter to trigger the action. Then fill all these fields required for sending an email.&#x20;

* apiKey: A string field that requires your API key, which serves as an authentication mechanism for accessing Mailjet's services.&#x20;
* apiSecretKey: A string field for the secret API key that corresponds to your API key, used to enhance security and verify your API requests.&#x20;
* fromEmail: The sender's email address, indicating who the email is being sent from.&#x20;
* fromName: The sender's name or the display name associated with the sender's email address.&#x20;
* toEmail: The recipient's email address, indicating who will receive the email.&#x20;
* toName: The recipient's name or a display name associated with their email address.&#x20;
* subject: A string that holds the subject or topic of the email, conveying the main purpose or content of the message.&#x20;
* textPart: Plain text part of the email's content, which is typically shown when HTML rendering is unavailable.&#x20;
* htmlPart: Used to store the HTML-formatted version of the email's content, enabling rich formatting and styling for the email's appearance.

{% hint style="info" %}
**apiKey**, **apiSecretKey** is what we get from Step 1

The **fromEmail** must be an approved sender connected to your Mailjet account.
{% endhint %}

{% hint style="info" %}
You can use `${event.value}` in **textPart** so that what you entered in input element will be sent as the text part of the email.&#x20;
{% endhint %}

{% hint style="info" %}
You can use a form to collect multiple input and control all these parameters seamlessly. See [use-custom-form-container-to-collect-user-inputs](https://docs.acho.io/app-builder/popular-use-cases/use-custom-form-container-to-collect-user-inputs "mention") for details.
{% endhint %}

{% hint style="info" %}
If you want to automate the send email process, consider using an auto-updated Query Node to trigger the **Send an email** action, and use [Action condition](https://docs.acho.io/app-builder/app-construction/interactions/add-conditions-to-interactions) to control it.
{% endhint %}

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2F2CdaiOdQu7KiftB9vxtj%2Fimage.png?alt=media&#x26;token=25085d31-f7dd-4e9e-b675-b80acd370c71" alt=""><figcaption></figcaption></figure>

### 5. Test&#x20;

Go to [preview](https://docs.acho.io/app-builder/preview) to test the interaction. In this example, I used the input value as the text part of the email.\
![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FTTTJM21eSeCoOngYY06T%2Fimage.png?alt=media\&token=8d901310-c336-43d9-8fd5-b28898ff4978)![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2Fh6A3FvINqrweSQrSMx6c%2Fimage.png?alt=media\&token=5e1a5078-7498-4cf2-9c7c-af5da1794597)
