Sending data charts

Sidemail no-code email editor features chart element that allows you to visualize data like time series inside of emails you send out.

Include an array of numbers (must be greater than zero) inside the templateProps parameter to pass the data to the chart. The key name you for the chart data array must match the name you specified in the template element's options.


Set up email template

First, you'll need to create an template in the no-code email editor and use the chart element. You can choose either line chart or bar chart.

The variable name you set up in the chart element, you'll than use in the send email method to pass data to the chart inside of templateProps parameter.

Code example

const configureSidemail = require("sidemail");
const sidemail = configureSidemail({ apiKey: "replace-with-your-api-key" });
const response = await sidemail.sendEmail({
	toAddress: "",
	fromAddress: "",
	fromName: "Your app",
	templateName: "Weekly report",
	templateProps: {
		chart: [100, 200, 300, 400, 200, 300, 200, 500]