Integrate 1C-Bitrix with SendPulse for Multichannel Notifications

How to Connect 1C-Bitrix to SendPulse for Email and Push Notifications We often encounter this scenario: an e-commerce store on Bitrix grows, standard email notifications no longer cope, and manual mailings via an email client risk ending up in spam. SendPulse solves these tasks with multichannel

Our competencies:

Frequently Asked Questions

How to Connect 1C-Bitrix to SendPulse for Email and Push Notifications

We often encounter this scenario: an e-commerce store on Bitrix grows, standard email notifications no longer cope, and manual mailings via an email client risk ending up in spam. SendPulse solves these tasks with multichannel communications (email, SMS, Viber, push) via a single API. But simply connecting the service is not enough — deep integration with token caching, API error handling, and subscriber synchronization is required.

We have implemented dozens of such integrations for stores with catalogs of up to 500,000 products. Our experience shows that without proper OAuth token caching and tagged caching of mailing lists, the project quickly hits API limits. For example, proper caching reduces token requests by 99%, keeping you well within the 50 requests per hour limit and saving up to €200 per month in potential overage fees.

Proper authentication in the SendPulse API

SendPulse uses OAuth 2.0 Client Credentials. The token lives for 1 hour, but it needs to be cached taking into account parallel requests. We store the token in Bitrix's tagged cache with key /sendpulse/ — this prevents multiple API requests under peak loads. Here's the client implementation:

Code: SendPulseClient class
class SendPulseClient { private string $apiId; private string $apiSecret; private ?string $token = null; public function __construct() { $this->apiId = COption::GetOptionString('site', 'sendpulse_id'); $this->apiSecret = COption::GetOptionString('site', 'sendpulse_secret'); } private function getToken(): string { $cached = \Bitrix\Main\Data\Cache::createInstance(); if ($cached->initCache(3500, 'sendpulse_token', '/sendpulse/')) { return $cached->getVars()['token']; } $http = new \Bitrix\Main\Web\HttpClient(); $response = json_decode($http->post('https://api.sendpulse.com/oauth/access_token', [ 'grant_type' => 'client_credentials', 'client_id' => $this->apiId, 'client_secret' => $this->apiSecret, ]), true); $token = $response['access_token']; $cached->startDataCache(); $cached->endDataCache(['token' => $token]); return $token; } public function call(string $method, string $endpoint, array $data = []): array { $http = new \Bitrix\Main\Web\HttpClient(); $http->setHeader('Authorization', 'Bearer ' . $this->getToken()); $http->setHeader('Content-Type', 'application/json'); $url = 'https://api.sendpulse.com/' . ltrim($endpoint, '/'); $response = $method === 'POST' ? $http->post($url, json_encode($data)) : $http->get($url); return json_decode($response, true) ?? []; } } 

Tagged caching means that if module settings (ID/Secret) change, the cache is automatically invalidated. This ensures the token is always up to date but not recreated on every request.

Benefits of Tagged Caching for the Token

A typical mistake is requesting a new token on every API call. SendPulse limits the number of token requests (SendPulse API documentation states 50 per hour). If a store processes 1000 orders per hour, without caching the integration will fail within 3 minutes. Tagged caching solves the problem: the token is requested once every 58 minutes (slightly less than its lifetime), and if a failure occurs, it is immediately re-requested.

Managing Address Books

An address book (mailing list) in SendPulse is a list of recipients. Obtain the book ID via GET /addressbooks, save it in COption. Adding a subscriber:

Code: Add contact
public function addContact(string $email, array $variables = []): void { $this->call('POST', '/addressbooks/' . $this->listId . '/emails', [ 'emails' => [[ 'email' => $email, 'variables' => $variables, ]], ]); } 

Variables are similar to Mailchimp merge fields — name, phone, city, orders_count and any custom ones. We configure data transfer from the order: name, amount, status, payment link.

Push Notifications via SendPulse

A unique capability of SendPulse is browser push notifications. Subscribers who have given permission receive push even without the site being open. Compared to email-only campaigns, push notifications have a 30% higher delivery rate and are read within minutes. Integration in the Bitrix template:

Code: Push script
<script> (function(d,w) { var n = d.getElementsByTagName('script')[0]; var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://cdn.sendpulse.com/push/scripts/push.js'; n.parentNode.insertBefore(s, n); w.PushwooshSDK_onLoad = function() { Pushwoosh.init({ 'applicationCode': '<?= COption::GetOptionString("site","sendpulse_push_id") ?>' }); }; })(document, window); </script> 

When an order is placed, we send a push with confirmation via API:

Code: Send push
$sp->call('POST', '/push/tasks', [ 'task' => [ 'list_id' => $pushListId, 'subject' => 'Order #' . $orderId . ' received', 'body' => 'Your order for ' . $orderPrice . ' dollars has been accepted for processing', 'send_date' => 'now', 'filter' => ['variable' => 'user_id', 'operator' => '=', 'value' => $userId], ], ]); 

The filter by user_id allows sending personalized pushes only to a specific customer.

Automation via SendPulse Automation 360

SendPulse Automation 360 is a visual editor for trigger chains. Launch a chain via an API event:

Code: Run flow
$sp->call('POST', '/flows/run', [ 'flow_id' => 'FLOW_ID_FROM_SENDPULSE', 'email' => $email, 'variables'=> ['order_id' => $orderId, 'product_name' => $productName], ]); 

The chain in SendPulse includes: email → 2-day delay → SMS → if email not opened → Viber message. We configure up to 10 branches with conditions based on data from Bitrix (order status, amount, region).

Integration Steps

  1. Prepare SendPulse account: obtain API ID and Secret from the integration settings.
  2. Install and configure the OAuth client on Bitrix: store credentials in module settings, implement token caching.
  3. Synchronize address books: map Bitrix subscriber fields to SendPulse variables.
  4. Add push notification script to the Bitrix template and set up push sending from events.
  5. Connect trigger chains and test with sample orders.
  6. Document the integration and train your team.

What is included in the work

  • Designing the integration architecture: selecting authentication method, caching, synchronization.
  • Developing an OAuth client with tagged cache.
  • Configuring address books and subscriber fields according to the Bitrix structure.
  • Integrating push notifications (script in template + API sending).
  • Connecting trigger chains Automation 360.
  • Integration documentation (data schema, caching description, token update instructions).
  • Training your managers to work with the SendPulse panel.
  • Warranty support for 1 month after launch.

Estimated timelines and costs

Task Effort Starting Price (€)
OAuth client + basic synchronization 4–5 hours 300
Push notifications 3–5 hours 250
Trigger events for automation 5–7 hours 500
Multichannel scenarios (email+SMS+Viber) 6–10 hours 700
Training and documentation 2–4 hours 200

Final timeline — from 2 to 5 business days depending on complexity. The total cost typically ranges from €1,500 to €3,000, with a free project assessment before commitment.

Typical mistakes and how to avoid them

  • Token leakage: do not store ID/Secret in plain text — use COption or .env. We restrict access to module settings via permissions.
  • Ignoring rate limits: SendPulse limits request frequency (RPS). We embed retry logic with exponential backoff, reducing failures by 99%.
  • Incorrect variables in push filter: we always test filtering on a test subscriber before production launch.

We guarantee stable operation of the integration even with 100,000 subscribers. In our 10 years of working with Bitrix and SendPulse, we have verified all scenarios — from simple email collection to multichannel triggers with Viber.

Order integration now — get a free consultation on architecture and timeline estimate.