Menu

#1511 How do I make a notification? ( LINE NOTIFY & Gmail)

None
open
nobody
None
1
2018-05-17
2018-05-17
No

How do I make a notification? ( LINE NOTIFY & Gmail)

  • I want to insert the code Line Notify. When time is booked. Keep alert through line notify
  • Gmail Notify Config Success
    Exam.

$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;

}

}

Discussion

  • Campbell Morrison

    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.

     
  • Admin Scotch

    Admin Scotch - 2018-05-17

    Ok.Thank You

     
  • Admin Scotch

    Admin Scotch - 2018-05-17

    i want delete post,i don't find delete this post

     
  • Campbell Morrison

    • Group: -->
     
  • Campbell Morrison

    Delete the whole ticket, or just the original post? Or even just the token?

     
  • Anonymous

    Anonymous - 2018-05-17

    yes

     
  • Campbell Morrison

    Which?

     
MongoDB Logo MongoDB