The SMTP provider enables you to deliver professional transactional emails to your customers through the Comify Platform using your own SMTP server. With a single API integration, you can create seamless multi-channel communication experiences while maintaining full control over your email infrastructure.
Getting Started
Implementing the SMTP email provider requires two primary steps: configuring your SMTP server details and setting up the SMTP integration within your Comify platform.
SMTP Server Requirements
To use the SMTP provider with Comify, you’ll need access to an SMTP server with the following information:
SMTP Host : The address of your SMTP server (e.g., smtp.example.com)
SMTP Port : The port used for SMTP communication (common ports include 25, 465, 587)
Protocol : The security protocol used (TLS is recommended for secure email transmission)
Username : Your SMTP server authentication username
Password : Your SMTP server authentication password
Creating a Comify API Key
Before configuring the SMTP integration, you’ll need to generate a Comify API key for authentication:
Access your Comify account dashboard.
Navigate to the API Keys management section at https://cloud.comify.io/settings/api-keys .
Select “Generate API Key” if not already generated.
Provide a clear, descriptive name for your key (e.g., “SMTP Integration”) to facilitate future management.
Copy and store this API key in a secure location. You’ll use this key in your application code to authenticate requests to the Comify platform.
Configuring SMTP Integration in Comify
To establish the connection between Comify and your SMTP server:
Sign in to your Comify platform dashboard.
Navigate to Integration Store > Add Integration > E-mail.
From the available email service providers, select SMTP.
Complete the following fields in the configuration form:
Identifier : A unique name to identify this SMTP integration (e.g., “company_smtp”)
Description : Optional description of the SMTP integration
Host : Your SMTP server address (e.g., smtp.example.com)
Port : The SMTP server port (e.g., 587)
Protocol : Select TLS from the dropdown menu
Username : Your SMTP server username
Password : Your SMTP server password
Click Save Integration to finalize the setup.
Creating Email Templates
After successfully configuring the SMTP integration, you can design email templates directly within the Comify platform:
Navigate to the Manage Templates section in your Comify dashboard.
Select the Email
tab from the available channel options.
Click Create Template
to begin the design process.
Choose from multiple template creation methods based on your preference and skill level:
AI-Assisted Design : Utilize the AI Writer
feature in the Email Editor section for automated content generation.
Manual HTML Editing : Select Switch to HTML
in the Email Editor for direct code editing.
Import Existing Templates : Use the Chrome extension to copy HTML from existing templates for reuse in Comify.
Sending Email Templates
Implement the following code examples in your application to trigger email template delivery:
Node.js Node.js (Fetch) Python Ruby PHP Go Curl const { Comify } = require ( 'comify-node' )
const comm = new Comify ( 'COMIFY_API_KEY' )
comm . triggerComm ( 'email_template_name' ,{
"order_id" : "123455" ,
"billing" : {
"customerEmail" : "contact@comify.io" ,
"customerName" : "Comify"
}
}, 'email' )
const { Comify } = require ( 'comify-node' )
const comm = new Comify ( 'COMIFY_API_KEY' )
comm . triggerComm ( 'email_template_name' ,{
"order_id" : "123455" ,
"billing" : {
"customerEmail" : "contact@comify.io" ,
"customerName" : "Comify"
}
}, 'email' )
const fetch = require ( 'node-fetch' );
const apiKey = 'YOUR_COMIFY_API_KEY' ;
const url = 'https://commify.transify.tech/v1/comm' ;
const payload = {
name: 'email_template_name' ,
payload: {
order_id: '123455' ,
billing: {
customerEmail: 'contact@comify.io' ,
customerName: 'Comify'
}
},
type: 'email'
};
fetch ( url , {
method: 'POST' ,
headers: {
'Authorization' : `ApiKey ${ apiKey } ` ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ( payload )
})
. then ( response => response . json ())
. then ( data => console . log ( data ))
. catch ( error => console . error ( 'Error:' , error ));
import requests
api_key = 'YOUR_COMIFY_API_KEY'
url = 'https://commify.transify.tech/v1/comm'
headers = {
'Authorization' : f 'ApiKey { api_key } ' ,
'Content-Type' : 'application/json'
}
payload = {
'name' : 'email_template_name' ,
'payload' : {
'order_id' : '123455' ,
'billing' : {
'customerEmail' : 'contact@comify.io' ,
'customerName' : 'Comify'
}
},
'type' : 'email'
}
response = requests.post(url, headers = headers, json = payload)
print (response.json())
require 'net/http'
require 'uri'
require 'json'
api_key = 'YOUR_COMIFY_API_KEY'
url = URI . parse ( 'https://commify.transify.tech/v1/comm' )
payload = {
name: 'email_template_name' ,
payload: {
order_id: '123455' ,
billing: {
customerEmail: 'contact@comify.io' ,
customerName: 'Comify'
}
},
type: 'email'
}
http = Net :: HTTP . new (url. host , url. port )
http. use_ssl = true
request = Net :: HTTP :: Post . new (url. request_uri )
request[ 'Authorization' ] = "ApiKey #{ api_key } "
request[ 'Content-Type' ] = 'application/json'
request. body = payload. to_json
response = http. request (request)
puts response. body
<? php
$api_key = 'YOUR_COMIFY_API_KEY' ;
$url = 'https://commify.transify.tech/v1/comm' ;
$payload = [
'name' => 'email_template_name' ,
'payload' => [
'order_id' => '123455' ,
'billing' => [
'customerEmail' => 'contact@comify.io' ,
'customerName' => 'Comify'
]
],
'type' => 'email'
];
$ch = curl_init ( $url );
curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , true );
curl_setopt ( $ch , CURLOPT_POST , true );
curl_setopt ( $ch , CURLOPT_POSTFIELDS , json_encode ( $payload ));
curl_setopt ( $ch , CURLOPT_HTTPHEADER , [
'Authorization: ApiKey ' . $api_key ,
'Content-Type: application/json'
]);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response ;
package main
import (
" bytes "
" encoding/json "
" fmt "
" io/ioutil "
" net/http "
)
func main () {
apiKey := "YOUR_COMIFY_API_KEY"
url := "https://commify.transify.tech/v1/comm"
type Billing struct {
CustomerEmail string `json:"customerEmail"`
CustomerName string `json:"customerName"`
}
type PayloadData struct {
OrderID string `json:"order_id"`
Billing Billing `json:"billing"`
}
type RequestPayload struct {
Name string `json:"name"`
Payload PayloadData `json:"payload"`
Type string `json:"type"`
}
payload := RequestPayload {
Name : "email_template_name" ,
Payload : PayloadData {
OrderID : "123455" ,
Billing : Billing {
CustomerEmail : "contact@comify.io" ,
CustomerName : "Comify" ,
},
},
Type : "email" ,
}
jsonPayload , err := json . Marshal ( payload )
if err != nil {
fmt . Println ( "Error marshaling JSON:" , err )
return
}
req , err := http . NewRequest ( "POST" , url , bytes . NewBuffer ( jsonPayload ))
if err != nil {
fmt . Println ( "Error creating request:" , err )
return
}
req . Header . Set ( "Authorization" , "ApiKey " + apiKey )
req . Header . Set ( "Content-Type" , "application/json" )
client := & http . Client {}
resp , err := client . Do ( req )
if err != nil {
fmt . Println ( "Error sending request:" , err )
return
}
defer resp . Body . Close ()
body , err := ioutil . ReadAll ( resp . Body )
if err != nil {
fmt . Println ( "Error reading response:" , err )
return
}
fmt . Println ( "Response:" , string ( body ))
}
curl -X POST 'https://commify.transify.tech/v1/comm' \
-H 'Authorization: ApiKey YOUR_COMIFY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "email_template_name",
"payload": {
"order_id": "123455",
"billing": {
"customerEmail": "contact@comify.io",
"customerName": "Comify"
}
},
"type": "email"
}'
Upon successful API request processing, you will receive a response containing a unique requestId and confirmation message:
{
"success" : true ,
"message" : "Communication triggered successfully" ,
"data" : {
"requestId" : "0a6a4a9c-6e5b-4b5c-9c4d-3e2f1c8b7a6e"
}
}
Best Practices for SMTP Email Delivery
Authenticate Your Domain : Set up SPF, DKIM, and DMARC records for your sending domain to improve deliverability.
Monitor Bounce Rates : Keep track of email bounces and remove invalid addresses from your lists.
Use TLS Encryption : Always configure your SMTP integration to use TLS for secure email transmission.
Test Before Sending : Utilize Comify’s preview functionality to test your emails before sending them to customers.
Implement Dynamic Content : Leverage Comify’s template variables to personalize your emails for each recipient.