[kmail2] [Bug 361083] Creating custom actions for mail messages in KMail interface

Murz via KDE Bugzilla bugzilla_noreply at kde.org
Tue Mar 29 07:36:49 BST 2016


https://bugs.kde.org/show_bug.cgi?id=361083

--- Comment #8 from Murz <MurzNN at gmail.com> ---
I plan to create custom cli script like crm_create_ticket.php with something:
<?php
  $input = file_get_contents("php://stdin");
  preg_match('/^CLIENT_NAME: (.*)$/', $input, $matches);
  $client_name=$matches[1];
  preg_match('/^MESSAGE_TITLE: (.*)$/', $input, $matches);
  $post['ticket_title']=$matches[1];
  preg_match('/^MESSAGE_TEXT: (.*)$\nCLIENT_NAME/', $input, $matches);
  $post['ticket_body']="Client name: $client_name \n Query: \n $matches[1];

    curl_setopt($curl, CURLOPT_URL, 'http://mycrm.com/create_ticket.php');
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
    $out = curl_exec($curl);
    echo $out;
    curl_close($curl);
?>
Or maybe bash equivalent of this process. 
So if KMail provide way to exec scripts and send message values to stdin of
script, there will be wide way for customisation and automation of mail
processing.

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list