|
|
@ -25,16 +25,16 @@ $app->post('/mailgun', function() use($app) { |
|
|
|
); |
|
|
|
|
|
|
|
if(k($params, 'Subject')) |
|
|
|
$data['name'] = k($params, 'Subject'); |
|
|
|
$data['name'] = trim(k($params, 'Subject')); |
|
|
|
|
|
|
|
if(k($params['body-plain']) |
|
|
|
$data['content'] = k($params, 'body-plain'); |
|
|
|
if(k($params, 'body-plain')) |
|
|
|
$data['content'] = trim(k($params, 'body-plain')); |
|
|
|
|
|
|
|
// Set tags for any hashtags used in the body
|
|
|
|
if(preg_match_all('/#([^ ]+)/', $data['content'], $matches)) { |
|
|
|
$tags = array(); |
|
|
|
foreach($matches[1] as $m) |
|
|
|
$tags[] = $m; |
|
|
|
$tags[] = trim($m); |
|
|
|
if($tags) { |
|
|
|
if($user->send_category_as_array != 1) { |
|
|
|
$data['category'] = $tags; |
|
|
|