base.template.ts249 lines, 6.6 KB
| 1 | export interface EmailTemplateContent { |
| 2 | title: string; |
| 3 | body: string; |
| 4 | buttonText?: string; |
| 5 | buttonUrl?: string; |
| 6 | } |
| 7 | |
| 8 | export const baseEmailTemplate = (content: EmailTemplateContent): string => { |
| 9 | const buttonSection = |
| 10 | content.buttonText && content.buttonUrl |
| 11 | ? ` |
| 12 | <div class="button-container"> |
| 13 | <a href="${content.buttonUrl}" class="button">${content.buttonText}</a> |
| 14 | </div> |
| 15 | |
| 16 | <div class="link-container"> |
| 17 | <p class="link-text">Or copy this URL:</p> |
| 18 | <a href="${content.buttonUrl}" class="link">${content.buttonUrl}</a> |
| 19 | </div> |
| 20 | ` |
| 21 | : ""; |
| 22 | |
| 23 | return ` |
| 24 | <!DOCTYPE html> |
| 25 | <html lang="en"> |
| 26 | <head> |
| 27 | <meta charset="UTF-8"> |
| 28 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 29 | <title>${content.title}</title> |
| 30 | <style> |
| 31 | /* Modern Reset */ |
| 32 | * { |
| 33 | margin: 0; |
| 34 | padding: 0; |
| 35 | box-sizing: border-box; |
| 36 | } |
| 37 | |
| 38 | body { |
| 39 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; |
| 40 | line-height: 1.6; |
| 41 | color: #1a1a1a; |
| 42 | -webkit-font-smoothing: antialiased; |
| 43 | background-color: #f5f5f5; |
| 44 | } |
| 45 | |
| 46 | /* Container */ |
| 47 | .container { |
| 48 | max-width: 600px; |
| 49 | margin: 0 auto; |
| 50 | background-color: #ffffff; |
| 51 | border-radius: 16px; |
| 52 | box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); |
| 53 | overflow: hidden; |
| 54 | } |
| 55 | |
| 56 | /* Header */ |
| 57 | .header { |
| 58 | background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); |
| 59 | padding: 40px 20px; |
| 60 | text-align: center; |
| 61 | position: relative; |
| 62 | } |
| 63 | |
| 64 | .header::after { |
| 65 | content: ''; |
| 66 | position: absolute; |
| 67 | bottom: 0; |
| 68 | left: 0; |
| 69 | right: 0; |
| 70 | height: 40px; |
| 71 | background: linear-gradient(to bottom right, transparent 49%, #ffffff 50%); |
| 72 | } |
| 73 | |
| 74 | .header h1 { |
| 75 | color: #ffffff; |
| 76 | font-size: 28px; |
| 77 | font-weight: 800; |
| 78 | margin: 0; |
| 79 | letter-spacing: -0.5px; |
| 80 | } |
| 81 | |
| 82 | .logo { |
| 83 | width: 80px; |
| 84 | height: 80px; |
| 85 | margin-bottom: 20px; |
| 86 | border-radius: 16px; |
| 87 | background: rgba(255, 255, 255, 0.1); |
| 88 | backdrop-filter: blur(10px); |
| 89 | padding: 15px; |
| 90 | } |
| 91 | |
| 92 | /* Content */ |
| 93 | .content { |
| 94 | padding: 40px 30px; |
| 95 | } |
| 96 | |
| 97 | .content h1 { |
| 98 | color: #1a1a1a; |
| 99 | font-size: 24px; |
| 100 | font-weight: 700; |
| 101 | margin-bottom: 24px; |
| 102 | text-align: center; |
| 103 | } |
| 104 | |
| 105 | .content p { |
| 106 | color: #4b5563; |
| 107 | font-size: 16px; |
| 108 | margin-bottom: 20px; |
| 109 | line-height: 1.7; |
| 110 | } |
| 111 | |
| 112 | /* Feature Card */ |
| 113 | .feature-card { |
| 114 | background: #f8fafc; |
| 115 | border-radius: 12px; |
| 116 | padding: 24px; |
| 117 | margin: 24px 0; |
| 118 | border: 1px solid #e2e8f0; |
| 119 | } |
| 120 | |
| 121 | /* Button */ |
| 122 | .button-container { |
| 123 | text-align: center; |
| 124 | margin: 32px 0 24px; |
| 125 | } |
| 126 | |
| 127 | .button { |
| 128 | display: inline-block; |
| 129 | background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); |
| 130 | color: #ffffff !important; |
| 131 | padding: 16px 32px; |
| 132 | border-radius: 12px; |
| 133 | text-decoration: none; |
| 134 | font-weight: 700; |
| 135 | font-size: 16px; |
| 136 | transition: all 0.3s ease; |
| 137 | box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2); |
| 138 | text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); |
| 139 | letter-spacing: 0.3px; |
| 140 | } |
| 141 | |
| 142 | .button:hover { |
| 143 | transform: translateY(-2px); |
| 144 | box-shadow: 0 6px 8px rgba(79, 70, 229, 0.25); |
| 145 | background: linear-gradient(135deg, #4338CA 0%, #6D28D9 100%); |
| 146 | } |
| 147 | |
| 148 | /* Link */ |
| 149 | .link-container { |
| 150 | text-align: center; |
| 151 | background: #f8fafc; |
| 152 | border-radius: 8px; |
| 153 | padding: 12px; |
| 154 | margin-top: 16px; |
| 155 | } |
| 156 | |
| 157 | .link-text { |
| 158 | font-size: 14px; |
| 159 | color: #6b7280; |
| 160 | margin-bottom: 8px !important; |
| 161 | } |
| 162 | |
| 163 | .link { |
| 164 | word-break: break-all; |
| 165 | color: #4F46E5; |
| 166 | text-decoration: none; |
| 167 | font-size: 14px; |
| 168 | border-bottom: 1px dashed #4F46E5; |
| 169 | } |
| 170 | |
| 171 | /* Footer */ |
| 172 | .footer { |
| 173 | text-align: center; |
| 174 | padding: 32px 20px; |
| 175 | background: #f8fafc; |
| 176 | border-top: 1px solid #e2e8f0; |
| 177 | } |
| 178 | |
| 179 | .footer p { |
| 180 | color: #6b7280; |
| 181 | font-size: 14px; |
| 182 | margin-bottom: 8px; |
| 183 | } |
| 184 | |
| 185 | .social-links { |
| 186 | margin-top: 20px; |
| 187 | } |
| 188 | |
| 189 | .social-link { |
| 190 | display: inline-block; |
| 191 | margin: 0 8px; |
| 192 | color: #4F46E5; |
| 193 | text-decoration: none; |
| 194 | font-size: 14px; |
| 195 | } |
| 196 | |
| 197 | /* Responsive */ |
| 198 | @media screen and (max-width: 600px) { |
| 199 | .container { |
| 200 | border-radius: 0; |
| 201 | } |
| 202 | |
| 203 | .content { |
| 204 | padding: 30px 20px; |
| 205 | } |
| 206 | |
| 207 | .header h1 { |
| 208 | font-size: 24px; |
| 209 | } |
| 210 | |
| 211 | .button { |
| 212 | padding: 14px 28px; |
| 213 | } |
| 214 | } |
| 215 | </style> |
| 216 | </head> |
| 217 | <body style="padding: 20px;"> |
| 218 | <div class="container"> |
| 219 | <div class="header"> |
| 220 | <div class="logo"> |
| 221 | <svg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"> |
| 222 | <path d="M12 4L3 8L12 12L21 8L12 4Z" /> |
| 223 | <path d="M3 14L12 18L21 14" opacity="0.6" /> |
| 224 | <path d="M3 10L12 14L21 10" opacity="0.8" /> |
| 225 | </svg> |
| 226 | </div> |
| 227 | <h1>AI Video Summarizer</h1> |
| 228 | </div> |
| 229 | |
| 230 | <div class="content"> |
| 231 | <h1>${content.title}</h1> |
| 232 | ${content.body} |
| 233 | ${buttonSection} |
| 234 | </div> |
| 235 | |
| 236 | <div class="footer"> |
| 237 | <p>© ${new Date().getFullYear()} AI Video Summarizer. All rights reserved.</p> |
| 238 | <p>If you didn't request this email, please ignore it.</p> |
| 239 | <div class="social-links"> |
| 240 | <a href="#" class="social-link">Twitter</a> |
| 241 | <a href="#" class="social-link">LinkedIn</a> |
| 242 | <a href="#" class="social-link">GitHub</a> |
| 243 | </div> |
| 244 | </div> |
| 245 | </div> |
| 246 | </body> |
| 247 | </html> |
| 248 | `; |
| 249 | }; |