How do I make a notification? ( LINE NOTIFY & Gmail)
Brought to you by:
jberanek
How do I make a notification? ( LINE NOTIFY & Gmail)
$name = $_POST['name'];
$subject = $_POST['subject'];
$detail = $_POST['detail'];
$room= $_POST['room'];
$date = $_POST['date];
$message = $name."\n".'=Name: '.$subject."\n".'subject: '.$detail."\n".'room: '.$date."\n";
define('LINE_API',"https://notify-api.line.me/api/notify");
define('LINE_TOKEN','CBgUthgzmC7LMKSIYhznqpEU3jjGO3QAQZg36a3uhrA');
function notify_message($message){
$queryData = array('message' => $message);
$queryData = http_build_query($queryData,'','&');
$headerOptions = array(
'http'=>array(
'method'=>'POST',
'header'=> "Content-Type: application/x-www-form-urlencoded\r\n"
."Authorization: Bearer ".LINE_TOKEN."\r\n"
."Content-Length: ".strlen($queryData)."\r\n",
'content' => $queryData
)
);
$context = stream_context_create($headerOptions);
$result = file_get_contents(LINE_API,FALSE,$context);
$res = json_decode($result);
return $res;
}
}
You'll have to explain a little more. Do you want to know when to trigger a notification? Probably the easiest thing to do is just to modify the email notifications so that a LINE notification is just another type of notification. You'll need to modify functions_mail.inc and also $need_to_send_mail which is set up in language.inc.
Ok.Thank You
i want delete post,i don't find delete this post
Delete the whole ticket, or just the original post? Or even just the token?
yes
Which?