feat: Implement blog and blog post models, routes, and services
- Added Blog and BlogPost models with necessary fields and relationships. - Created blogRouter for handling blog-related API endpoints including CRUD operations. - Developed BlogService for business logic related to blogs and posts, including sharing functionality. - Implemented API client methods for frontend to interact with blog-related endpoints. - Added internationalization support for blog-related text in English and German. - Created Vue components for blog editing, listing, and viewing, including a rich text editor for post content. - Enhanced user experience with form validations and dynamic visibility settings based on user input.
This commit is contained in:
@@ -53,5 +53,19 @@ export const sendAnswerEmail = async (toEmail, answer, language) => {
|
||||
html: `<p>${ answer }</p>`
|
||||
};
|
||||
|
||||
await transporter.sendMail(mailOptions);
|
||||
};
|
||||
|
||||
export const sendBlogShareEmail = async (toEmail, blogUrl, blogTitle, senderName) => {
|
||||
const subject = `yourPart: ${senderName} hat einen Blog geteilt`;
|
||||
const text = `${senderName} hat den Blog "${blogTitle}" mit dir geteilt. Du kannst ihn hier ansehen: ${blogUrl}`;
|
||||
const html = `<p><strong>${senderName}</strong> hat den Blog "${blogTitle}" mit dir geteilt.</p><p>Hier ansehen: <a href="${blogUrl}">${blogUrl}</a></p>`;
|
||||
const mailOptions = {
|
||||
from: process.env.SMTP_FROM,
|
||||
to: toEmail,
|
||||
subject,
|
||||
text,
|
||||
html
|
||||
};
|
||||
await transporter.sendMail(mailOptions);
|
||||
};
|
||||
Reference in New Issue
Block a user