-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.html
89 lines (82 loc) · 3.14 KB
/
sample.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Content</title>
<link href="sample.css" rel="stylesheet"/>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<style>
.share-btn {
text-align: center;
}
.share-btn > a {
display: inline-block;
border: 1px solid #000080;
border-radius: 20px;
padding: 5px;
font-size: 14px;
margin-bottom: 3px;
font-family: Verdana, Arial;
width: 90px;
text-align: center;
}
.share-btn > a:hover {
cursor: pointer;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null
}
document.addEventListener('DOMContentLoaded', (event) => {
getMessage();
});
function getMessage() {
fetch('https://pastor-insights-service.gaianet.ai/webhook/ahg0lRP83barIc5if7N4/message/' + getURLParameter("mid"), {
method: 'GET',
credentials: "include",
}).then(function(response) {
return response.json();
}).then(function(data) {
console.log(data);
if (data['status']) {
document.title = data["subject"];
window.ShareButtons.update();
document.getElementById("subject").innerHTML = data["subject"];
document.getElementById("body").innerHTML = "<b><i>" + data["question"] + "</i></b><br>" + marked.parse(data["body"]);
} else {
document.getElementById("subject").innerHTML = "Sorry, please try again";
document.getElementById("body").innerHTML = data["message"];
}
}).catch(error => {
console.error('Error:', error);
document.getElementById("subject").innerHTML = "Sorry, please try again";
});
}
</script>
</head>
<body>
<div class="email-container">
<div class="email-header">
<h1 id="subject">Please wait ...</h1>
</div>
<div class="email-body" id="body">
</div>
<div class="share-btn" id="share-btn">
<a class="btn-twitter" data-id="tw"><i class="fab fa-twitter"></i> Twitter</a>
<a class="btn-telegram" data-id="tg"><i class="fab fa-telegram"></i> Telegram</a>
<a class="btn-whatsapp" data-id="wa"><i class="fab fa-whatsapp"></i> WhatsApp</a>
<a class="btn-reddit" data-id="re"><i class="fab fa-reddit"></i> Reddit</a>
<a class="btn-facebook" data-id="fb"><i class="fab fa-facebook-square"></i> Facebook</a>
<a class="btn-linkedin" data-id="in"><i class="fab fa-linkedin"></i> LinkedIn</a>
<a class="btn-mail" data-id="mail"><i class="fas fa-at"></i> Email</a>
</div>
<div class="email-footer">
<p><a href="index.html">← Get email like this in your own mailbox!</a></p>
</div>
</div>
<script src="//cdn.jsdelivr.net/npm/share-buttons/dist/share-buttons.js"></script>
</body>
</html>