-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparticipantslist.js
More file actions
263 lines (216 loc) · 11.3 KB
/
participantslist.js
File metadata and controls
263 lines (216 loc) · 11.3 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
require("dotenv").config();
const admin = require("firebase-admin");
// import { createTeams } from "./createTeams_export.js";
const reader = require('xlsx')
const nodemailer = require('nodemailer');
const serviceAccount = {
"type": process.env.FIREBASE_TYPE,
"project_id": process.env.FIREBASE_PROJECT_ID,
"private_key_id": process.env.FIREBASE_PRIVATE_KEY_ID,
"private_key": process.env.FIREBASE_PRIVATE_KEY.replace(/\\n/g, '\n'),
"client_email": process.env.FIREBASE_CLIENT_EMAIL,
"client_id": process.env.FIREBASE_CLIENT_ID,
"auth_uri": process.env.FIREBASE_AUTH_URI,
"token_uri": process.env.FIREBASE_TOKEN_URI,
"auth_provider_x509_cert_url": process.env.FIREBASE_AUTH_PROVIDER,
"client_x509_cert_url": process.env.FIREBASE_CLIENT_CERT_URL
};
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: process.env.FIREBASE_DATABASE_URL
});
const db = admin.database();
const participantsRef = db.ref("participants");
const transporter = nodemailer.createTransport({
direct:true,
host: 'smtp.yandex.com',
port: 465,
auth: {
user: 'ahmet.bayir.leader@yandex.com',
pass: 'AHMETbay123321' },
secure: true
})
const mailOptions = {
// Hangi sağlayıcıyı kullanıyorsanız onun bilgilerini girmelisiniz.
from: `Denemeee`,
to: 'abayir41@gmail.com',
subject: `Burası başlık kısmı`,
text: `Buraya text girebilirsiniz..`,
html: `<h1>Buraya html girebilirsiniz.</h1>`
}
let func = async () => {
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
console.log(error)
}
console.log('Message %s sent: %s', info.messageId, info.response)
})
}
func();
function getMailTemplate(password){
const htmlBody =
`<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<!--[if !mso]><!--><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
<title></title>
<style type="text/css">
@media only screen and (min-width: 570px) {
.u-row {
width: 550px !important;
}
.u-row .u-col {
vertical-align: top;
}
.u-row .u-col-100 {
width: 550px !important;
}
}
@media (max-width: 570px) {
.u-row-container {
max-width: 100% !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.u-row .u-col {
min-width: 320px !important;
max-width: 100% !important;
display: block !important;
}
.u-row {
width: calc(100% - 40px) !important;
}
.u-col {
width: 100% !important;
}
.u-col > div {
margin: 0 auto;
}
}
body {
margin: 0;
padding: 0;
}
table,
tr,
td {
vertical-align: top;
border-collapse: collapse;
}
p {
margin: 0;
}
.ie-container table,
.mso-container table {
table-layout: fixed;
}
* {
line-height: inherit;
}
a[x-apple-data-detectors='true'] {
color: inherit !important;
text-decoration: none !important;
}
table, td { color: #000000; } </style>
<!--[if !mso]><!--><link href="https://fonts.googleapis.com/css?family=Cabin:400,700&display=swap" rel="stylesheet" type="text/css"><!--<![endif]-->
</head>
<body class="clean-body u_body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #ecf0f1;color: #000000">
<!--[if IE]><div class="ie-container"><![endif]-->
<!--[if mso]><div class="mso-container"><![endif]-->
<table style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #ecf0f1;width:100%" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: #ecf0f1;"><![endif]-->
<div class="u-row-container" style="padding: 0px;background-image: url(' ');background-repeat: no-repeat;background-position: center top;background-color: #310740">
<div class="u-row" style="Margin: 0 auto;min-width: 320px;max-width: 550px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #9a1ec8;">
<div style="border-collapse: collapse;display: table;width: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-image: url(' ');background-repeat: no-repeat;background-position: center top;background-color: #310740;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:550px;"><tr style="background-color: #9a1ec8;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="550" style="background-color: #9a1ec8;width: 550px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 550px;display: table-cell;vertical-align: top;">
<div style="background-color: #9a1ec8;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;"><!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px;font-family:arial,helvetica,sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="cid:image2" alt="border" title="border" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 100%;max-width: 550px;" width="550"/>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:25px 40px 70px;font-family:arial,helvetica,sans-serif;" align="left">
<div style="color: #ffffff; line-height: 200%; text-align: left; word-wrap: break-word;">
<p style="font-size: 14px; line-height: 200%; text-align: center;"> </p>
<p style="font-size: 14px; line-height: 200%; text-align: center;"><span style="font-size: 24px; line-height: 48px;"><strong><span style="line-height: 48px; font-size: 24px;">Boğaziçi Game Jam 22</span></strong></span></p>
<p style="font-size: 14px; line-height: 200%;"> </p>
<p style="font-size: 14px; line-height: 200%; text-align: justify;"><span style="font-size: 18px; line-height: 36px;"><strong><span style="font-family: Cabin, sans-serif; line-height: 36px; font-size: 18px;">Selam Jammer,</span></strong></span></p>
<p style="font-size: 14px; line-height: 200%; text-align: justify;"><span style="font-size: 18px; line-height: 36px;"><span style="font-family: Cabin, sans-serif; line-height: 36px; font-size: 18px;">Boğaziçi Game</span><span style="font-family: Cabin, sans-serif; line-height: 36px; font-size: 18px;"> Jam 22'ye hoş geldin, hep birlikte 15 Nisan'da büyük bir yarışmaya başlıyor olacağız. </span></span></p>
<p style="font-size: 14px; line-height: 200%; text-align: justify;"> </p>
<p style="font-size: 14px; line-height: 200%; text-align: justify;"><span style="font-size: 18px; line-height: 36px;"><span style="font-family: Cabin, sans-serif; line-height: 36px; font-size: 18px;">Yarışmaya katılmak için aşağıdaki doğrulama kodunu Discord kanalımızdaki doğrulama kanalına yazarak kendini onaylatman gerekmektedir.</span></span></p>
<p style="font-size: 14px; line-height: 200%; text-align: justify;"> </p>
<p style="font-size: 14px; line-height: 200%; text-align: justify;"><span style="font-size: 18px; line-height: 36px;"><span style="font-family: Cabin, sans-serif; line-height: 36px; font-size: 18px;">Doğrulama Kodun : <strong>`+password+`</strong></span></span></p>
<p style="font-size: 14px; line-height: 200%; text-align: justify;"> </p>
<p style="font-size: 14px; line-height: 200%; text-align: justify;"><span style="font-size: 18px; line-height: 36px;"><span style="font-family: Cabin, sans-serif; line-height: 36px; font-size: 18px;">Herhangi bir sorun olursa Discord'da yardım kanalına yazabilirsin.</span></span></p>
<p style="font-size: 14px; line-height: 200%;"> </p>
<p style="font-size: 14px; line-height: 200%;"><span style="font-size: 18px; line-height: 36px;"><strong><span style="font-family: Cabin, sans-serif; line-height: 36px; font-size: 18px;">Yarışmada Görüşmek Üzere</span></strong></span></p>
<p style="font-size: 14px; line-height: 200%;"> </p>
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:0px;font-family:arial,helvetica,sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if mso]></div><![endif]-->
<!--[if IE]></div><![endif]-->
</body>
</html>
`;
return htmlBody;
}