CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/IncidentTracker/notifiers/Basecamp.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace COREPOS\Fannie\Plugin\IncidentTracker\notifiers;

class Basecamp
{

    public function send($incident, $address)
    {
        $msg = "*Type*: {$incident['incidentSubType']}\n"
            . "*Store*: {$incident['storeName']}\n"
            . "*Location*: {$incident['incidentLocation']}\n"
            . "*Entered By*: {$incident['userName']}\n"
            . "*Called Police*: {$incident['police']}\n"
            . "*Requested Trespass*: {$incident['trespass']}\n"
            . "*Details*:\n"
            . $incident['details'];
        $curl = curl_init($address);
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, 'content=' . urlencode($msg));
        $res = curl_exec($curl);
        curl_close($curl);
    }
}