Showing posts with label Email Platform. Show all posts
Showing posts with label Email Platform. Show all posts

Saturday, May 1, 2021

Tuesday, April 13, 2021

Mautic Cronjob Setup

 Mautic Cron Jobs are as follows:


#Segments Every 2 Minutes

*/2 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:segments:update

*/3 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:import


#Campaigns (Every 1 Minute)

* * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:campaigns:update 

* * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:campaigns:trigger

* * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:messages:send


#Process Email Queue Every 5 Minutes

*/5 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:emails:send #Fetch and Process Monitored Email Every 10 Minutes

*/10 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:email:fetch


#Process Email Queue Every 5 Minutes

*/5 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:emails:send


#Fetch and Process Monitored Email Every 10 Minutes

*/10 * * * * root /usr/bin/php /var/www/html/mautic/bin/console mautic:email:fetch


Leave a line between cron jobs



Friday, November 6, 2020

Send html Form or Post data to Sendgrid contact list


How to Send html Form or Post data to Sendgrid contact list using PHP through API using JSON

################################## API ##############################
$curl = curl_init();

$list_ids="<<Your Contact List ID>>";

$first_name=$_POST['first_name'];
$last_name=$_POST['last_name'];
$email=$_POST['email'];

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.sendgrid.com/v3/marketing/contacts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"list_ids\":[\"$list_ids\"],\"contacts\":[{\"address_line_1\":\"string (optional)\",\"address_line_2\":\"string (optional)\",\"city\":\"string (optional)\",\"country\":\"string (optional)\",\"email\":\"$email\",\"first_name\":\"$first_name\",\"last_name\":\"$last_name\",\"postal_code\":\"string (optional)\",\"state_province_region\":\"string (optional)\",\"custom_fields\":{}}]}",

  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer SG.XXXXXXXXXXXXXX",
    "content-type: application/json"
  ),
));
$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  //echo $response;
    $_SESSION['message'] = "Thank You, we will get back to you in the next few days";
    
    if(isset($_POST['contactus'])){
        header('Location: contact.php');
    } else{
        eader('Location: sign-up.php');
    }
}

################################## API ##############################

Upload file to server using Power Shell Command

 scp file_name.zip username@server_ip/server_address:/directory_path