diff --git a/VERSION.txt b/VERSION.txt index f3a1d04bd364..97e837542e9a 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.3.55 \ No newline at end of file +5.3.56 \ No newline at end of file diff --git a/app/Jobs/PostMark/ProcessPostmarkWebhook.php b/app/Jobs/PostMark/ProcessPostmarkWebhook.php index e3444172777c..e2f1355f3044 100644 --- a/app/Jobs/PostMark/ProcessPostmarkWebhook.php +++ b/app/Jobs/PostMark/ProcessPostmarkWebhook.php @@ -88,6 +88,8 @@ class ProcessPostmarkWebhook implements ShouldQueue return $this->processBounce(); case 'SpamComplaint': return $this->processSpamComplaint(); + case 'Open': + return $this->processOpen(); default: # code... break; @@ -95,6 +97,59 @@ class ProcessPostmarkWebhook implements ShouldQueue } +// { +// "Metadata": { +// "example": "value", +// "example_2": "value" +// }, +// "RecordType": "Open", +// "FirstOpen": true, +// "Client": { +// "Name": "Chrome 35.0.1916.153", +// "Company": "Google", +// "Family": "Chrome" +// }, +// "OS": { +// "Name": "OS X 10.7 Lion", +// "Company": "Apple Computer, Inc.", +// "Family": "OS X 10" +// }, +// "Platform": "WebMail", +// "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36", +// "ReadSeconds": 5, +// "Geo": { +// "CountryISOCode": "RS", +// "Country": "Serbia", +// "RegionISOCode": "VO", +// "Region": "Autonomna Pokrajina Vojvodina", +// "City": "Novi Sad", +// "Zip": "21000", +// "Coords": "45.2517,19.8369", +// "IP": "188.2.95.4" +// }, +// "MessageID": "00000000-0000-0000-0000-000000000000", +// "MessageStream": "outbound", +// "ReceivedAt": "2022-02-06T06:37:48Z", +// "Tag": "welcome-email", +// "Recipient": "john@example.com" +// } + + private function processOpen() + { + + $this->invitation->opened_date = now(); + $this->invitation->save(); + + SystemLogger::dispatch($this->request, + SystemLog::CATEGORY_MAIL, + SystemLog::EVENT_MAIL_OPENED, + SystemLog::TYPE_WEBHOOK_RESPONSE, + $this->invitation->contact->client, + $this->invitation->company + ); + + } + // { // "RecordType": "Delivery", // "ServerID": 23, diff --git a/app/Models/SystemLog.php b/app/Models/SystemLog.php index 2565c4d003b4..95672410ef15 100644 --- a/app/Models/SystemLog.php +++ b/app/Models/SystemLog.php @@ -50,6 +50,7 @@ class SystemLog extends Model const EVENT_MAIL_BOUNCED = 32; const EVENT_MAIL_SPAM_COMPLAINT = 33; const EVENT_MAIL_DELIVERY = 34; + const EVENT_MAIL_OPENED = 35; const EVENT_WEBHOOK_RESPONSE = 40; const EVENT_WEBHOOK_SUCCESS = 41; diff --git a/config/ninja.php b/config/ninja.php index 64676a4cc41f..74799917a7f2 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.3.55', - 'app_tag' => '5.3.55', + 'app_version' => '5.3.56', + 'app_tag' => '5.3.56', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),