-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskpane.html
92 lines (81 loc) · 3.34 KB
/
taskpane.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
90
91
92
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<!-- Office JavaScript API -->
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>
</head>
<body>
<div class="container">
<p>This add-in will insert the text fetched from a server in a new message.</p>
<form action="" id="test_form">
<div class="form-group row">
<label class="col-sm-2" for="email_type">Email Typ</label>
<div class="col-sm-10">
<select name="email_type" id="email_type">
<option value="meeting_request">Terminanfrage</option>
<option value="status_update">Statusupdate</option>
<option value="product_offer">Produkt Angebot</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2" for="gender">Anrede</label>
<div class="col-sm-10">
<select name="gender" id="gender">
<option value="-">-</option>
<option value="mr">Herr</option>
<option value="mrs">Frau</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2" for="name">Name</label>
<div class="col-sm-10">
<input type="text" name="name" id="name">
</div>
</div>
<div>
<input type="submit">
</div>
</form>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script>
Office.onReady((info) => {
if (info.host === Office.HostType.Outlook) {
$('#test_form').submit(function(e) {
e.preventDefault();
let query = $(e.target).serialize();
let url = 'https://localhost:3000/?' + query;
$.ajax({
url: url,
cache: false
})
.done(function( text ) {
console.log(text);
appendText(text);
});
});
}
});
function appendText(text) {
Office.context.mailbox.item.body.setAsync(
text,
{
coercionType: "html", // Write text as HTML
},
// Callback method to check that setAsync succeeded
function (asyncResult) {
if (asyncResult.status ==
Office.AsyncResultStatus.Failed) {
write(asyncResult.error.message);
}
}
);
};
</script>
</html>