Новые правки компоентов
This commit is contained in:
parent
423b436140
commit
a8164ec227
2 changed files with 39 additions and 8 deletions
|
|
@ -22,19 +22,19 @@ async function sendViaSmtpBz(options: EmailOptions): Promise<boolean> {
|
|||
try {
|
||||
console.log('[SMTP.BZ] Sending to:', options.to);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('from', FROM_EMAIL);
|
||||
formData.append('name', FROM_NAME);
|
||||
formData.append('to', options.to);
|
||||
formData.append('subject', options.subject);
|
||||
formData.append('html', options.html);
|
||||
|
||||
const response = await fetch('https://api.smtp.bz/v1/smtp/send', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Authorization': SMTP_BZ_API_KEY,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
from: FROM_EMAIL,
|
||||
name: FROM_NAME,
|
||||
to: options.to,
|
||||
subject: options.subject,
|
||||
html: options.html,
|
||||
}),
|
||||
body: formData,
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue