How To Send Email Through HubSpot CRM Using SMTP API
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=2YmREnrP
BY fathimath.sajila
7 months ago
HubSpot
0
comments comment

We can send email through HubSpot CRM using SMTP API. For sending email SMTP, first we need to create the SMTP tokens.

Generate SMTP API Tokens

An API token provides both a username and password which can then be used to send email through the HubSpot SMTP APi. We can create SMTP token using the API link below.

https://api.hubapi.com/email/public/v1/smtpapi/tokens?hapikey=demo

Example: Use the following code for generating json code,

$post_arr = array(
    'createdBy' => 'demo@hubspot.com',
    'campaignName' => 'Transactional Email For Test'
  );
  $post_json = json_encode($post_arr);
  $hubspot_api_url = 'https://api.hubapi.com/email/public/v1/smtpapi/tokens?hapikey=demo';
  $response = drupal_http_request($hubspot_api_url, 
   array('Content-Type' => 'application/x-www-form-urlencoded'),
   'POST', $post_json);

A sample json response is shown below,

{
  "userName": "asdfghjkl@11111.smtp.hubspot.net",
  "password": "3432fff8eljl1249fjjasdfnv3",
  "portalId": 11111,
  "emailCampaignId": 14862038,
  "createdAt": 1415660606232,
  "deleted": false,
  "createdBy": "abcd@hubspot.com",
  "appId": 22709,
  "campaignName": "Test Transactional Email"
}

From there we get the SMTP Hostname, SMTP Port, SMTP User Name,SMTP Password. Now we can send email through HubSpot CRM using these SMTP values.


RELATED ARTICLE

close

on 13th August 2015 / by fathimath.sajila
The API is allow you to create a functional application or integration quickly and easily. JSON will be returned in all responses from the API, including errors. The API needs two types of authentication, one is OAuth and the other is API keys. API Integration HubSpot Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 14th August 2015 / by fathimath.sajila
The Deal API is used to easy integration of Hubspot CRM. Deals API is provide a one:many relationship with contacts and companies.This is important for any integration to add deals to a contact or company. Now we can look on to the Deal API'S. API HubSpot Leave a reply Your email address will not be published. Required fields are marker *
Leave a reply
Your email address will not be published. Required fields are marker *

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
The content of this field is kept private and will not be shown publicly.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.