Add telegram sending feature
parent
29003326b3
commit
7a16b722cd
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
function sendTelegram() {
|
||||
app.dialog.preloader("Sending...");
|
||||
apirequest(SETTINGS.apis.sendtelegram, {
|
||||
accountnumber: getStorage("accountnumber"),
|
||||
accountkey: getStorage("accountkey"),
|
||||
message: $("#telegrammessage").val(),
|
||||
to: $("#telegramto").val(),
|
||||
from: $("#telegramfrom").val(),
|
||||
instructions: $("#telegraminstructions").val()
|
||||
}, function (resp) {
|
||||
app.dialog.close();
|
||||
if (resp.status == "OK") {
|
||||
app.dialog.alert(resp.msg, "Telegram Sent!");
|
||||
} else if (resp.status == "ERROR") {
|
||||
app.dialog.alert(resp.msg, "Error");
|
||||
}
|
||||
}, function (error) {
|
||||
app.dialog.close();
|
||||
app.dialog.alert("There's a server or network problem. Check your Internet connection or try again later.", "Error");
|
||||
});
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<div class="page" data-name="telegram">
|
||||
|
||||
<div class="navbar">
|
||||
<div class="navbar-bg"></div>
|
||||
<div class="navbar-inner">
|
||||
<div class="left">
|
||||
<a class="link back" href="#">
|
||||
<i class="icon icon-back"></i>
|
||||
<span class="if-not-md">Back</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="title">Telegram</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-100 medium-90 xlarge-75 margin-horizontal">
|
||||
<div class="card margin">
|
||||
<div class="card-content text-align-center padding-vertical" id="pickupRequestForm">
|
||||
<div class="list media-list">
|
||||
<ul>
|
||||
<li class="padding text-align-center">
|
||||
Send a telegram with Helena Express for $15.
|
||||
We'll hand-deliver your message to anywhere in Helena, East Helena, Montana City, the Helena Valley, and the hills around Helena.
|
||||
If you put in a destination outside the Helena area, your telegram will be delivered by the postal service.
|
||||
If the recipient isn't home, we'll leave a note and try again the following day, usually at a different time of day.
|
||||
If nobody answers the second time, we'll either leave the telegram at their front door or,
|
||||
if you request it in the special instructions, send it to them via the U.S. Mail.
|
||||
</li>
|
||||
<li class="padding text-align-center" id="addPaymentMethodNag" style="display: none;">
|
||||
<i class="fad fa-exclamation-circle fa-2x text-color-orange"></i><br>
|
||||
You need an account with a linked credit card to send a telegram in the app. <span class="taptext">Tap</span><span class="clicktext">Click</span> the button to update your account.
|
||||
<a class="button hapticbtn button-fill margin" href="/account"><i class="fas fa-user-circle"></i> My Account</a>
|
||||
</li>
|
||||
<li class="item-content item-input item-input-outline">
|
||||
<div class="item-inner">
|
||||
<div class="item-title item-floating-label">Message</div>
|
||||
<div class="item-input-wrap">
|
||||
<textarea id="telegrammessage" rows="5" class="resizable" placeholder=""></textarea>
|
||||
<span class="input-clear-button"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-content item-input item-input-outline">
|
||||
<div class="item-inner">
|
||||
<div class="item-title item-floating-label">To</div>
|
||||
<div class="item-input-wrap">
|
||||
<textarea id="telegramto" rows="3" placeholder="John Smith 123 Sample Rd Helena MT 59601"></textarea>
|
||||
<span class="input-clear-button"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-content item-input item-input-outline">
|
||||
<div class="item-inner">
|
||||
<div class="item-title item-floating-label">From</div>
|
||||
<div class="item-input-wrap">
|
||||
<textarea id="telegramfrom" rows="3" placeholder=""></textarea>
|
||||
<span class="input-clear-button"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-content item-input item-input-outline">
|
||||
<div class="item-inner">
|
||||
<div class="item-title item-floating-label">Special Instructions</div>
|
||||
<div class="item-input-wrap">
|
||||
<textarea id="telegraminstructions" rows="2" class="resizable" placeholder="Request specific delivery date/time, add delivery instructions, etc"></textarea>
|
||||
<span class="input-clear-button"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="padding">
|
||||
By pressing the "Send Telegram" button, you agree that we can
|
||||
bill your saved payment method for $15.
|
||||
</li>
|
||||
<li class="padding">
|
||||
<div class="button hapticbtn button-fill" onclick="sendTelegram()"><i class="fas fa-paper-plane"></i> Send Telegram</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
Loading…
Reference in New Issue