Sometimes there is a need to start a series of events with bypassing the stage of authorization in SendPulse email service
To be able to send an unauthorized event you will need to know the contact's email address and their phone number (at least one of these parameters)
Also, you will need the so-called Event Hash value — it consists of 32 characters, and you can find it here:
Log in to your SendPulse account, Open Automations menu
Open the Events Manager
Click on the event you need to activate
Copy the value from the Post Raw tab — it is the last two blocks of characters, displayed after the /id/ block
Send this value together with the contact's email address and/or phone number
Example for PHP
<?php
require_once 'Automation360.php';
//Last parameter from "POST URL"
// https://login.sendpulse.com/emailservice/events/
$eventHash = 'e5a0e6aa4abd4d43a9a28cbff32c2515/6741804';
$email = 'email@domain.com';
$phone = '380931112233';
$variables = [
'user_id' => 123123,
'event_date' => date('Y-m-d'),
'firstname' => 'Name',
'lastname' => 'Family',
'age' => 23
];
$automationClient = new Automation360($eventHash);
$result = $automationClient->sendEventToSendpulse($email, $phone, $variables);
if($result['data']['result']){
echo 'Send request is completed';
}else {
echo $result['data']['message'];
}
Example for Python
from Automation360 import Automation360
eventHash = 'e5a0e6aa4abd4d43a9a28cbff32c2515/6741804'
variables = dict(
user_id=1231231,
firstName="Name",
lastName="Family",
age=23)
email = 'email@domain.com'
phone = '380931112233'
# if empty email or phone
# phone = None
# or
# email = None
automationClient = Automation360(eventHash)
result = automationClient.send_event_to_sendpulse(email, phone, variables)
print(result)
Last Updated: 2020-07-15
Sign up with
Sign in with Facebook Sign in with Google