forked from vattav90/vattav90.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebPushTesting.html
86 lines (70 loc) · 3.74 KB
/
WebPushTesting.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
<!DOCTYPE html>
<html>
<head>
<title>Web Push Migration Simulation</title>
<style>
#container {
display: flex;
border: 1px solid black;
padding: 10px;
justify-content: center;
max-width: 400px;
max-height: 400px;
margin: auto;
align-items: center;
}
.email {
width: 100%;
display: flex;
line-height: 20px;
}
#sub {
display: flex;
justify-content: space-end;
width: 100%;
}
.subscribe {
width: 10%;
display: flex;
justify-content: space-end;
margin-right: 20%;
}
#submit {
display: flex;
justify-content: center;
margin-top:10px;
}
</style>
<script id='_webengage_script_tag' type='text/javascript'>
var webengage;!function(w,e,b,n,g){function o(e,t){e[t[t.length-1]]=function(){r.__queue.push([t.join("."),
arguments])}}var i,s,r=w[b],z=" ",l="init options track screen onReady".split(z),a="feedback survey notification".split(z),c="options render clear abort".split(z),p="Open Close Submit Complete View Click".split(z),u="identify login logout setAttribute".split(z);if(!r||!r.__v){for(w[b]=r={__queue:[],__v:"6.0",user:{}},i=0;i < l.length;i++)o(r,[l[i]]);for(i=0;i < a.length;i++){for(r[a[i]]={},s=0;s < c.length;s++)o(r[a[i]],[a[i],c[s]]);for(s=0;s < p.length;s++)o(r[a[i]],[a[i],"on"+p[s]])}for(i=0;i < u.length;i++)o(r.user,["user",u[i]]);setTimeout(function(){var f=e.createElement("script"),d=e.getElementById("_webengage_script_tag");f.type="text/javascript",f.async=!0,f.src=("https:"==e.location.protocol?"https://ssl.widgets.webengage.com":"http://cdn.widgets.webengage.com")+"/js/webengage-min-v-6.0.js",d.parentNode.insertBefore(f,d)})}}(window,document,"webengage");webengage.init("~47b6624a");
</script>
<script type="text/javascript">
(function(i,s,o,g,r,a,m,n){i.moengage_object=r;t={};q=function(f){return function(){(i.moengage_q=i.moengage_q||[]).push({f:f,a:arguments})}};f=['track_event','add_user_attribute','add_first_name','add_last_name','add_email','add_mobile','add_user_name','add_gender','add_birthday','destroy_session','add_unique_user_id','moe_events','call_web_push','track','location_type_attribute'],h={onsite:["getData","registerCallback"]};for(k
in f){t[f[k]]=q(f[k])}for(k in h)for(l in h[k]){null==t[k]&&(t[k]={}),t[k][h[k][l]]=q(k+"."+h[k][l])}a=s.createElement(o);m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m);i.moe=i.moe||function(){n=arguments[0];return t};a.onload=function(){if(n){i[r]=moe(n)}}})(window,document,'script','https://cdn.moengage.com/webpush/moe_webSdk.min.latest.js','Moengage')
Moengage = moe({
app_id:"BUPA6VJRJ94MMU1YETJW52KI",
debug_logs: 0
});
</script>
</head>
<body>
<div id="container">
<form id="form">
<label for="fname" id="email1" class="email">Email ID:</label>
<input type="email" id="email" class="email" name="email" required>
<div id="submit"><input type="submit" value="Submit" ></div>
</form>
</div>
<script>
document.getElementById("submit").onclick = function(e){
const valid = document.getElementById('form');
if (valid.checkValidity()){
e.preventDefault();
Moengage.add_unique_user_id(document.getElementById("email").value);
console.log(document.getElementById("email").value);
document.getElementById("container").innerHTML = ("Thank you!")}
};
</script>
</body>
</html>