feat: fixes and formatter
This commit is contained in:
+16
-17
@@ -1,18 +1,17 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const musicLandLogoBase64 = fs.readFileSync(
|
||||
path.join(__dirname, "../assets/musicLandLogo.png"),
|
||||
{ encoding: "base64" },
|
||||
);
|
||||
const musicLandLogoSrc = `data:image/png;base64,${musicLandLogoBase64}`;
|
||||
const musicLandLogoBase64 = fs.readFileSync(path.join(__dirname, '../assets/musicLandLogo.png'), {
|
||||
encoding: 'base64',
|
||||
})
|
||||
const musicLandLogoSrc = `data:image/png;base64,${musicLandLogoBase64}`
|
||||
|
||||
function basicTemplate({ title = "", content = "", button = null }) {
|
||||
function basicTemplate({ title = '', content = '', button = null }) {
|
||||
const btn = button?.url
|
||||
? `<p><a href="${button.url}" style="display:inline-block;padding:10px 16px;background:#6C5CE7;color:#fff;border-radius:8px;text-decoration:none">${
|
||||
button?.label || "Ouvrir"
|
||||
button?.label || 'Ouvrir'
|
||||
}</a></p>`
|
||||
: "";
|
||||
: ''
|
||||
return `<!doctype html><html lang="fr" style="background-color:#0b0b10"><head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="color-scheme" content="dark" />
|
||||
@@ -50,12 +49,12 @@ function basicTemplate({ title = "", content = "", button = null }) {
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>`;
|
||||
</body></html>`
|
||||
}
|
||||
|
||||
function welcomeTemplate({ firstName = "", lastName = "" }) {
|
||||
const fullName = [firstName, lastName].filter(Boolean).join(" ").trim();
|
||||
const greeting = fullName ? `Salut ${fullName},` : "Salut,";
|
||||
function welcomeTemplate({ firstName = '', lastName = '' }) {
|
||||
const fullName = [firstName, lastName].filter(Boolean).join(' ').trim()
|
||||
const greeting = fullName ? `Salut ${fullName},` : 'Salut,'
|
||||
return `<!doctype html><html lang="fr" style="background-color:#0b0b10"><head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="color-scheme" content="dark" />
|
||||
@@ -104,8 +103,8 @@ function welcomeTemplate({ firstName = "", lastName = "" }) {
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>`;
|
||||
</body></html>`
|
||||
}
|
||||
|
||||
exports.basicTemplate = basicTemplate;
|
||||
exports.welcomeTemplate = welcomeTemplate;
|
||||
exports.basicTemplate = basicTemplate
|
||||
exports.welcomeTemplate = welcomeTemplate
|
||||
|
||||
Reference in New Issue
Block a user