Plugins
Templates

SendinBlue SMTP Plugin

Link to plugin page: https://zeroqode.com/plugin/sendinblue-smtp-1550378934452x281785382632685570

Introduction

Send mails to your customers with Sendinblue using your SMTP account, a free alternative instead of using Sendgrid. Also a good choice for sending mails without using default [email protected] This plugin uses the v3 APIversion (last version)

Prerequisites

To use this plugin you will need to:

  1. Create an account in Sendinblue: https://www.sendinblue.com/users/signup/

  2. In case when Sendinblue needs to verify your account (to prevent spammers). So sometimes before you can start sending emails, you have to send to Sendmail your page to verify the domain.

How to setup

  1. Add your v3 APIkey to the plugin settings tab

  2. Check your account is verified and ready to send emails

You're set to send emails!

Plugin Data/Actions Calls

There are 4 different workflows, below is explained for correct usage.

Data Calls

1. Get a List of emails

This endpoint will show the list of emails for the past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters.

You have 5 types of sorting to get the list of emails. You must specify at least one type for the call to work correctly.

1. email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. 2. templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose a transactional email. 3. messageId Mandatory if templateId and email are not passed in query filters. Message-ID of the transactional email sent. 4. startDatedate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. The maximum time period that can be selected is one month. 5. endDatedate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. The maximum time period that can be selected is one month.

Action Calls

2. Send SMTP Mail

We will use this workflow when we need to send a simple message to a user. This workflow is useful i.e for sending an activation URL, reset password, etc.

How to use (fields): (The * fields are required)

  • Sender_name: I.E: Alex Black

  • Sender_mail*: I.E: [email protected] (we suggest using the same mail that is configured on Sendinblue as sender mail)

  • To_email*: User mail I.E: [email protected]

  • To_name*: User name I.E: John

  • Message_html*: Message body (accepts HTML tags) NOTE! You cannot use double quotes ("some text")

  • Subject*: Message subject NOTE! You cannot use double quotes ("some text")

  • Email_toreply*: I.E: [email protected]

  • Name_toreply*: I.E: Zeroqode

3. Send SMTP Mail + File

This workflow is used when we need to send a simple message with an attached file. This workflow is useful i.e for sending invoices, birthday postals, or others. (We recommend use this workflow only when you need to send a file, because the file is required, so if you need to send only a message, don't use this one)

NOTE: You cannot use double quotes in subject or message ("some text")!

How to use (fields): (All the other fields are the same as point 1)

  • Filename_extension*: Here we can customize the filename that will receive the user. I.E: If we are sending a Jpeg image: Myfilename.jpg

  • URL*: File URL. Please note when we use the file from our database, it is stored in //s3…, so when we send the file - we need to set static http/s: then the URL of the file

URL method
  • content*: File content. If you are using a file from your database, use this field. To do this, you need to convert the file to Base64 code.

NOTE: Don't use both fields (URL and content) at the same time !!!

(Next 2 workflows: Templates). Please note you need a template. The sender name, sender mail is configured in Sendinblue when the template is created.

4. Send SMTP Mail + Template

You can send an email with a template created in your Sendinblue account.

Customize the call body according to your requirements:

The Example JSON body:

{ "sender":{ "email":"[email protected]" }, "to":[ { "email":"[email protected]" } ], "subject":"Test Subject2", "replyTo":{ "email":"[email protected]" }, "params":{ "name":"Alex K", "count":"Second" }, "templateId":2 }

You can customize the {body} content of the Send SMTP Mail + Template action. For example, you can add the sender name, reply_to name fields, and many more. It is necessary to stick to the JSON syntax rules. You can vaildate your {body} using any free JSON validator, like https://jsonlint.com/

Example of the customized {body} field.

The Sendinblue documentation can be viewed here https://developers.sendinblue.com/reference#sendtransacemail

To insert a template, add the required parameter to the call body

"templateId":2

where number is the template ID.

To add params from the template, add the required parameter to the call body

"params":{ "name":"Alex K", "count":"Second" },

where "name" is the paramsKey, "Alex K" is the paramsName

In the template on the Sendinblue side, the parameters are written as follows {{ params.paramsKey }}

5. Send SMTP Mail with ReplyTo

This workflow is used when we need to send a simple message with replyto parameter.

Changelogs

Update: 31/12/2020 –

  • Added new API - Get List of Emails: this data call offers information about emails

  • Added new API action - Send SMTP Mail with Reply: action call used to send emails with replyTo parameter

  • Changed Send SMTP Mail Template (A B C) to Send SMTP Mail + Template action with latest endpoint changes (Reference - https://developers.sendinblue.com/reference#sendtemplate-1)

Update: 03/06/2021 - Version 1.5.0

  • Updated defaults in call fields

Demo to preview the settings