Articles on: Integrations
This article is also available in:

Connecting SendGrid to send emails to customers of your online store

The integration with SendGrid will help automate the sending of emails to your online store customers after they place an order, allowing you to communicate more efficiently with your clients. An email with order details will be automatically sent to the customer after the order is created to the email address they enter in the email address field at checkout.

Important: This option is only available on trial and Pro subscriptions.
Bear in mind: Before you start sending your first emails with the SendGrid account, you need to create a sender identity.

Obtaining the API key on SendGrid



You can log in to your SendGrid account or create a new one by following this link.

After logging in, click the Settings button, and then in the list that appears below, select API Keys:


After that, click the Create API Key button:


Next, enter the name of your API key (arbitrary, in Latin letters) in the API Key Name field , then select the option below, called Full Access, and click Create & View:


Important: The “Full Access” option must be selected for the integration to work correctly. By default, it is automatically selected.

Done, your API key has been created! You need to copy it:


Note: The key will only be displayed once, so it must be copied immediately. However, if you lose this key, you can create a new one by repeating the above steps.

After the key is copied, click the Done button.

Connecting SendGrid to your online store on Weblium



Go to your site settings, open the Store section, then the Settings subsection, and go to the Client Emails tab:


After that click the Connect button on the right in the SendGrid section.

Paste the previously copied API key into the API Key field:


In the Sender's email field, enter the email address that will appear as the sender in emails to your online store customers.

Tip: In the email, the sender is usually specified in the from line.

Click the Save button in the upper right corner to save and activate the integration:


Important: Emails are sent when the order_created event fires, which occurs the moment a customer clicks the "Buy" button in the shopping cart. This happens even if the customer has not made a payment in the payment system connected to the site.

Customizing the subject and email text


After connecting the integration, emails to your customers will contain default text, which you can edit or replace with your own. To do this:

In the Email Subject field, you can enter your own subject for the emails to your customers, such as the name of your store, etc:


Note: By default, the subject is set to We received your order — {{instance.website_domain}}, where the variable {{instance.website_domain}} is replaced with your site's domain, e.g., example.com.

In the large Email Template field, you can enter the text of your email, which will be sent to customers after they place an order. To display a table with a list of products and other order details, the {{{order.formatted.products_table_html}}} variable is located in the text—this variable will be replaced with a table with order details (products, order amount, etc.). Similarly, other variables below display details about the customer (what the customer entered in the checkout fields) and the chosen shipping method.

Tip: You can personalize the text and add your contact phone number and company name (e.g., at the beginning or end of the email).

Below the email text field, you can click the Show variables button to open a modal window with a list of variables that can be used in the text:


If you copy a specific variable and add it to the text, the necessary data will be displayed in the email instead of the variable when the customer receives it. For example, in the text, you can display the order number or total amount, your site's domain, etc.

Note: Variables that correspond to short text values are enclosed in double curly braces (e.g., {{order.code}}). However, variables where blocks of information will be substituted are enclosed in triple braces. For example, the above-mentioned variable {{{order.formatted.products_table_html}}} — is enclosed within three curly braces on both sides.

In the Title field below, you can enter an internal name for this integration. It will be displayed in the "Client Emails" tab in the site settings—this may be necessary if you connect multiple integrations to differentiate them from each other.

Important: You can send up to 100 emails per day on a free SendGrid plan. If you need more, you are able to extend the limit. More details about it can be found here.

Additional settings



Sending emails based on the payment method

If payment methods are configured, you can select which will trigger email sending by checking the blue checkboxes under Send emails for selected payment method:


By default, all payment methods are activated, but if you want emails not to be sent for specific payment methods, you can deactivate them.

Tip: This may be useful when using a payment system that also automatically sends emails to your customers, like WayForPay. Or if you'd like to set up the integration and the text of the letter in it separately for different payment methods (accordingly, in one integration with SendGrid, leave some payment methods enabled, and in another integration, other payment methods).

Sending a test email

At the bottom of the integration settings in the Test Email section, you can click the Send test email button for us to send you a test email to the email address you use to log into your Weblium account:


This way, you can check the email's appearance and test this feature from the recipient's perspective.

Important: The shopping cart must have a field for entering an email address (and it should be made mandatory to fill) so that the system has information about where to send an actual (not test) letter. You can learn more about adding fields to the shopping cart here.

Deactivating the integration

If necessary, you can pause this integration without deleting it. To do this, return to the Client Emails tab and deactivate the switch next to SendGrid:

Updated on: 10/01/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!