Sleep

Vue- Email - Vue.js Feed

.Vue-email is encouraged through react-email, it allows our company make templates making use of the vue framework, along with parts that assist our company build design templates simply as well as quick.To start using vue-email in any sort of vue project, you only need to have to put in the bundle:.Along with NPM:.$ npm set up vue-email.With Anecdote:.$ anecdote include vue-email.Along with PNPM:.$ pnpm install vue-email.Developing e-mail theme.Produce a new e-mail design template in wherever you intend to have your themes, for this case, our experts can easily develop a template folder, along with a theme gotten in touch with welcome.vue.src/templates/welcome. vue.

name, appreciated to vue-email.A Vue part collection for building receptive e-mails.Perspective on GitHub.Pleased coding!David Arenas.
Rendering the layouts.Our company may utilize the make function, it receives pair of params, the 1st one is the design template to make, and the second the params to become used for the design template, and then pass the outcome layout in the body of demand.Passing the theme in the body system, provide our team the opportunity of leaving making use of any type of hosting server, share, fastify, nuxt in SSR, and so on src/pages/index. vue.Send email with nodemailer.Directed e-mail.
Send out email.In this particular instance i utilizing nuxt v3 since it allows our team to establish api inside very own project, and also determine numerous api options.Here our experts just extract the template of the demand physical body, and deliver the e-mail passing the design template in the sendMail function of the nodemailer package deal.src/server/api/ email.post.ts.bring in nodemailer coming from 'nodemailer'.export nonpayment defineEventHandler( async (occasion) =&gt const physical body = await readBody( event).const testAccount = await nodemailer.createTestAccount().const carrier = nodemailer.createTransport( ).const possibilities = from: 'you@example.com',.to: 'user@gmail.com',.target: 'hey there world',.html: body.template,..await transporter.sendMail( options). ).If you are certainly not making use of the hosting server in nuxt, you can conveniently carry out on any kind of structure for example making use of reveal:.import express coming from 'share'.bring in nodemailer from 'nodemailer'.const application = reveal().app.use( express.json()).app.post('/ api/send-email', async (req, res) =&gt const layout = req.body.const testAccount = await nodemailer.createTestAccount().const transporter = nodemailer.createTransport( ).const possibilities = coming from: 'you@example.com',.to: 'user@gmail.com',.target: 'hi there world',.html: theme,..await transporter.sendMail( choices).profit res.json( information: "Email sent out" ). ).app.listen( 3001 ).Paperwork.Receive the complete paperwork [listed below] ().Parts.You can view the components, listed here:.Assimilations.E-mails created along with vue-email may be exchanged HTML or even.clear text, and also sent out utilizing any type of email provider. You can find.examples listed below:.

Articles You Can Be Interested In